note 102207 deleted from function.array-push by danbrown
| From: | danbrown@php.net | Date: | Wed, 02 Feb 2011 16:52:53 +0000 |
| Subject: | note 102207 deleted from function.array-push by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176601@lists.php.net to get a copy of this message | ||
Note Submitter: Bas
----
Ariz Jacinto 27-Jun-2008 11:41
"if you're going to use array_push() to insert a "$key" => "$value"
pair into an array, it can be done using the following example:
array_push($data[$key], $value);"
Thats false and will give a warning.
If you want to add a key and value into an excisting array, you can simply use:
<?php
$data = array($key => $value);
?>