sticky Posted December 2, 2008 Share Posted December 2, 2008 when i use wamp to get to localhost to view this file <?php //$values = array( //1 => '25', // 2 => '45', // 3 => '75' // array $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' print_r ($meals); ?> it returns the following error::Parse error: syntax error, unexpected T_STRING, expecting ')' in C:\wamp\www\DWC_Remote\arrays.php on line 16 i don't know if its a configuration thing with wamp or coding error. if some one can help that would be great. as u can see i'm brand new to php but enjoying so far. Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 Learn arrays. $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' It is not closed. it should be $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' ); This should help http://djw-webdesign.awardspace.com/code.php?snippet=8 Quote Link to comment Share on other sites More sharing options...
awpti Posted December 2, 2008 Share Posted December 2, 2008 This is the syntax I use for arrays: <?php $my_array = array ( 'some_key' => 'some_value', 'another_key' => 'another_value' ); Can't miss the closing parenthesis if you do it that way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.