note 49910 deleted from function.count by sean
| From: | sean@php.net | Date: | Fri, 11 Feb 2005 20:43:39 +0000 |
| Subject: | note 49910 deleted from function.count by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84868@lists.php.net to get a copy of this message | ||
Note Submitter: info at thebase dot be
Reason: useless
----
I needed a fuction to reorder arrays, didnt found any so wrote one of my own... here's the
result:
<?php
$rry[48] = "mm";
$rry[50] = "aargh";
function ARRAY_REORDER($arry)
{
$a_count = count($arry);
$num = 0;
$b_count = 0;
while($b_count < $a_count):
if(isset($arry[$num])):
$new_arry[$b_count] = $arry[$num];
$b_count++;
endif;
$num++;
endwhile;
return($new_arry);
}
$new_arry = ARRAY_REORDER($rry);
print_r($rry);
print_r($new_arry);
?>
Gives the following output:
Array
(
[48] => mm
[50] => aargh
)
Array
( [0] => mm
[1] => aargh
)