mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-22 05:12:25 +01:00
Add array_merge ()
This commit is contained in:
parent
e38af6abb2
commit
467ccb3213
@ -42,6 +42,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* array_merge (PHP 4 >= 4.0.0)
|
||||
* array array_merge (array array1, array array2 [, array ...])
|
||||
* array_merge() merges the elements of two or more arrays together so that the values
|
||||
* of one are appended to the end of the previous one. It returns the resulting array.
|
||||
*/
|
||||
function array_merge ($array1, $array2, $array3 = '', $array4 = '', $array5 = '', $array6 = '', $array7 = '', $array8 = '', $array9 = '', $array10 = '')
|
||||
{
|
||||
$rarray = array ();
|
||||
|
||||
for ($i = 1; $i <= 10; $i++)
|
||||
{
|
||||
$this_array = ${'array' . $i};
|
||||
if (is_array ($this_array))
|
||||
{
|
||||
reset ($this_array);
|
||||
while (list ($key, $value) = each ($this_array))
|
||||
{
|
||||
if (is_int ($key))
|
||||
{
|
||||
$rarray[] = $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rarray[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $rarray;
|
||||
}
|
||||
|
||||
/* array_pop (PHP 4 >= 4.0.0)
|
||||
* mixed array_pop (array array)
|
||||
* array_pop() pops and returns the last value of the array, shortening the array by
|
||||
|
Loading…
Reference in New Issue
Block a user