note 87677 added to function.array-push
| From: | jbaptistapsilva at yahoo dot com dot br | Date: | Tue, 16 Dec 2008 15:49:07 +0000 |
| Subject: | note 87677 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148215@lists.php.net to get a copy of this message | ||
This is a simple function to merge two arrays.
<?php
function join_arrays($array1, $array2) {
$array_dest = $array1;
foreach($array2 as $element) {
$array_dest[ ] = $element;
}
return $array_dest;
}
?>
To use it, put this in your php code
<?php $array = join_arrays($array1, $array2) ?>
----
Server IP: 200.185.126.110
Probable Submitter: 189.107.194.12
----
Manual Page -- http://www.php.net/manual/en/function.array-push.php
Edit -- https://master.php.net/note/edit/87677
Del: integrated -- https://master.php.net/note/delete/87677/integrated
Del: useless -- https://master.php.net/note/delete/87677/useless
Del: bad code -- https://master.php.net/note/delete/87677/bad+code
Del: spam -- https://master.php.net/note/delete/87677/spam
Del: non-english -- https://master.php.net/note/delete/87677/non-english
Del: in docs -- https://master.php.net/note/delete/87677/in+docs
Del: other reasons-- https://master.php.net/note/delete/87677
Reject -- https://master.php.net/note/reject/87677
Search -- https://master.php.net/manage/user-notes.php