note 23882 modified in function.array-unshift by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:52:04 +0000 |
| Subject: | note 23882 modified in function.array-unshift by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79686@lists.php.net to get a copy of this message | ||
array_merge() will also reindex (see array_merge() manual entry), but the '+' operator
won't, so...
<?php
$arrayone=array("newkey"=>"newvalue") + $arrayone;
?>
does the job.
--was--
array_merge() will also reindex (see array_merge() manual entry), but the '+' operator
won't, so...
$arrayone=array("newkey"=>"newvalue") + $arrayone;
does the job.
http://php.net/manual/en/function.array-unshift.php