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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.