note 26901 added to language.operators
| From: | rick at brainscraps dot com | Date: | Sat, 16 Nov 2002 21:55:56 +0000 |
| Subject: | note 26901 added to language.operators | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39579@lists.php.net to get a copy of this message | ||
To add to Yasuo's detailed information above, I have seen no mention of '=>',
which is used for:
1. Associative array creation (http://www.php.net/manual/en/function.array.php),
$myarray = array("name"=>"Rick", "age"=>"No answer");
2. Associating keys and values in foreach()
(http://www.php.net/manual/en/control-structures.foreach.php)
foreach($myarray as $key=>$value){
echo "my $key is $value \n";
}
I don't know... I guess this could properly be called an array dereferencer (?), but
wouldn't it make sense to include this among the assignment operators?
--
http://www.php.net/manual/en/language.operators.php
http://master.php.net/manage/user-notes.php?action=edit+26901
http://master.php.net/manage/user-notes.php?action=delete+26901
http://master.php.net/manage/user-notes.php?action=reject+26901