Help printing arrays

Hi, I am trying to print the following array:

print("<td id='cell1'>$itemArray[$count][transport])>");

but instead of it giving the expected output i get this:

Array[transport]

I know the array assignment is correct because it will print if I first assign the array element to a variable, then substitute the variable in place of the array. It also works if I remove the double quotes on each side, but then I am unable to print the html code. Can anyone tell me what I am doing wrong?

I try to encourage keeping PHP out of strings, unless absolutely necessary. Stuff like that keeps little misunderstandings from happening:

[php]
echo “

” . $itemArray[$count][transport] . “)>”;
[/php]

I believe the following notation would also work, but don’t pin me down on that:

[php]
print("

{$itemArray[$count][transport]})>");
[/php]

The first one worked great, thanks!

Sponsor our Newsletter | Privacy Policy | Terms of Service