note 18657 deleted from function.array-push by didou
| From: | didou@php.net | Date: | Tue, 29 Jul 2003 11:58:37 +0000 |
| Subject: | note 18657 deleted from function.array-push by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-52912@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous@poster.com
----
Regarding:
Carl wrote that: "array_push() doesn't seem to allow you to push a key=>value pair onto
the array."
The correct syntax for this would be:
$array['newkey']=$newvalue;
You should not need the array_push function, but if so the example should read:
array_push($myarray,array("mykey"=>"myvalue"));
This will not return a syntax error.