note 83057 added to function.array-merge
| From: | david dot lay at axlr8 dot com | Date: | Thu, 08 May 2008 13:19:01 +0000 |
| Subject: | note 83057 added to function.array-merge | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139176@lists.php.net to get a copy of this message | ||
probably simpler versions of this (below) but thought i'd post my solution up as it might be
helpful :)
<?php
function array_merge_php4_comp() {
$n=func_num_args();
if( $n>0 ) {
$rval=func_get_arg(0);
if( !is_array($rval) ) {
$rval=(array)$rval;
}
if( $n>1 ) {
for( $i=1; $i<$n; $i++ ) {
$tval=func_get_arg($i);
if( !is_array($tval) ) {
$tval=(array)$tval;
}
$rval=array_merge($rval, $tval);
}
} else {
$rval=array_merge($rval);
}
} else {
$rval=array_merge();
}
return $rval;
}
?>
----
Server IP: 216.92.131.65
Probable Submitter: 62.105.180.178
----
Manual Page -- http://www.php.net/manual/en/function.array-merge.php
Edit -- https://master.php.net/note/edit/83057
Del: integrated -- https://master.php.net/note/delete/83057/integrated
Del: useless -- https://master.php.net/note/delete/83057/useless
Del: bad code -- https://master.php.net/note/delete/83057/bad+code
Del: spam -- https://master.php.net/note/delete/83057/spam
Del: non-english -- https://master.php.net/note/delete/83057/non-english
Del: in docs -- https://master.php.net/note/delete/83057/in+docs
Del: other reasons-- https://master.php.net/note/delete/83057
Reject -- https://master.php.net/note/reject/83057
Search -- https://master.php.net/manage/user-notes.php