Jump to content

can't see what i've done incorrectly


sticky

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/135084-cant-see-what-ive-done-incorrectly/
Share on other sites

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

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.