The following code will only display the last element of the array. What correction is needed to display the entire contents of the array?
[php]<?php $placename = array(“New York”, “Los Angeles”, “California”, “Chicago”, “Illinois”, “Houston”);
foreach ($placename as $location);
{
echo $location;
}
?>[/php]
Thanks for the help,
Jim
Remove the “;” after the for line… None used there as the command is still open…
foreach ($placename as $location);
becomes (as it should be)
foreach ($placename as $location)
Then it will work…