Jump to content

newbie question


caecastell

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.