array thing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rags
Forum Newbie
Posts: 1
Joined: Sat Oct 11, 2008 2:32 pm

array thing

Post by rags »

I am a php newbie..........just been a few days since ive started practising php and my first post on this forum........ heres the confusing code.......

Code: Select all

<?php
    $census_data = array(('New York'    => array('NY' => 8008278)));
?>
 
It gives me an error .......

PHP Parse error: syntax error, unexpected T_DOUBLE_ARROW in

but when i remove the extra pair of brackets inside the array function it seems to work just fine.....
i cant seem to understand why would the interpreter have a problem with that......... its syntactically proper in all the other languages that ive encountered up until now ........ could you throw some light on it....

thanks guys
User avatar
mattcooper
Forum Contributor
Posts: 210
Joined: Thu Mar 17, 2005 5:51 am
Location: London, UK

Re: array thing

Post by mattcooper »

rags wrote:could you throw some light on it....
Yeah, this is PHP and not the other languages you're used to; it has its own nuances. You've found the answer already and you now appear to have a new question about the interpreter itself... ;)

I learned long ago, "when in doubt, RTFM"
Post Reply