caecastell Posted March 5, 2007 Share Posted March 5, 2007 When I try to run the following in my browser I get an error: <<html> <head><basefont face="Arial"></head> </head> <body> <?php // define an array $flavors = array ('strawberry', 'grape', 'vanilla'); //extract values into variables list ($flavor1, $flavor2, $flavor3) = $flavors // returns strawberry echo $flavor2; ?> </body> </html> The error is on line 10, it doesn't like the echo for some reason. Any suggestions: Parse error: syntax error, unexpected T_ECHO in /home/zoeumsn/public_html/mytestfolder/isarray.php on line 10 Link to comment https://forums.phpfreaks.com/topic/41341-newbie-question/ Share on other sites More sharing options...
interpim Posted March 5, 2007 Share Posted March 5, 2007 put quotes around echo Link to comment https://forums.phpfreaks.com/topic/41341-newbie-question/#findComment-200302 Share on other sites More sharing options...
kenrbnsn Posted March 5, 2007 Share Posted March 5, 2007 You're missing the terminating semi-colon on this line: <?php list ($flavor1, $flavor2, $flavor3) = $flavors ?> Ken Link to comment https://forums.phpfreaks.com/topic/41341-newbie-question/#findComment-200310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.