note 92549 added to function.array-replace

From: Date: Wed, 29 Jul 2009 04:45:04 +0000
Subject: note 92549 added to function.array-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-158859@lists.php.net to get a copy of this message
For a backward compatible alternative, you might try something like this: <?php if (!function_exists('array_replace')) { function array_replace( array &$array, array &$array1 ) { $args = func_get_args(); $count = func_num_args(); for ($i = 0; $i < $count; ++$i) { if (is_array($args[$i])) { foreach ($args[$i] as $key => $val) { $array[$key] = $val; } } else { trigger_error( __FUNCTION__ . '(): Argument #' . ($i+1) . ' is not an array', E_USER_WARNING ); return NULL; } } return $array; } } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 72.67.36.93 ---- Manual Page -- http://www.php.net/manual/en/function.array-replace.php Edit -- https://master.php.net/note/edit/92549 Del: integrated -- https://master.php.net/note/delete/92549/integrated Del: useless -- https://master.php.net/note/delete/92549/useless Del: bad code -- https://master.php.net/note/delete/92549/bad+code Del: spam -- https://master.php.net/note/delete/92549/spam Del: non-english -- https://master.php.net/note/delete/92549/non-english Del: in docs -- https://master.php.net/note/delete/92549/in+docs Del: other reasons-- https://master.php.net/note/delete/92549 Reject -- https://master.php.net/note/reject/92549 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158859) next »