note 82077 added to function.array-push
| From: | alexander dot williamson at gmail dot com | Date: | Thu, 27 Mar 2008 00:06:05 +0000 |
| Subject: | note 82077 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137614@lists.php.net to get a copy of this message | ||
This will work to solve the associative array issues:
$aValues[$key] = $value;
Where $key is a unique identifier and $value is the value to be stored. Since the $key works off a
string or number, if you already have a $key with the same value as an existing $key, the element
will be overwritten.
e.g.
$aValues["one"] = "value of one";
$aValues["two"] = "different value of two!";
gives:
array([one] => "value of one", [two] => "value of two");
but will be overwritten when using the same key (one):
$aValues["one"] = "value of one";
$aValues["one"] = "different value of two!";
will give:
array([one] => "different value of two!");
3686
----
Server IP: 92.48.74.199
Probable Submitter: 86.158.254.133
----
Manual Page -- http://www.php.net/manual/en/function.array-push.php
Edit -- https://master.php.net/note/edit/82077
Del: integrated -- https://master.php.net/note/delete/82077/integrated
Del: useless -- https://master.php.net/note/delete/82077/useless
Del: bad code -- https://master.php.net/note/delete/82077/bad+code
Del: spam -- https://master.php.net/note/delete/82077/spam
Del: non-english -- https://master.php.net/note/delete/82077/non-english
Del: in docs -- https://master.php.net/note/delete/82077/in+docs
Del: other reasons-- https://master.php.net/note/delete/82077
Reject -- https://master.php.net/note/reject/82077
Search -- https://master.php.net/manage/user-notes.php