mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-06 05:20:40 +01:00
Add array_shift() - needs testing
This commit is contained in:
parent
c51972cd16
commit
ddd4181979
@ -98,6 +98,33 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function array_shift(&$array)
|
||||||
|
{
|
||||||
|
if(!is_array($array))
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
reset($array);
|
||||||
|
$rtrn = array();
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while(list($key,$value) = each($array))
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
if($i == 1)
|
||||||
|
{
|
||||||
|
$one = $value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$rtrn[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$array = $rtrn;
|
||||||
|
return $one;
|
||||||
|
}
|
||||||
|
|
||||||
function array_unique ($array)
|
function array_unique ($array)
|
||||||
{
|
{
|
||||||
reset($array);
|
reset($array);
|
||||||
|
Loading…
Reference in New Issue
Block a user