Chapter 1 page 74
I entered the following code as per the first "foreach" example on page 74 (down the bottom)...
<?php
$flavor[] = "blue raspberry";
$flavor[] = "root beer";
$flavor[] = "pineapple";
echo "My favorite flavors are:<br>";
foreach ($flavor, as $currentvalue) {
// these lines will execute as long as there is a value in $flavour
echo $currentvalue "<br>\n";
}
?>
When I open the php page I receive the following error...
Parse error: parse error, unexpected ',' in C:\Program Files\Apache Group\Apache2\test\array.php on line 6
I do not understand what I have done wrong.
Help!
David
|