note 112183 deleted from function.array-reverse by aharvey
| From: | aharvey@php.net | Date: | Fri, 24 May 2013 18:03:05 +0000 |
| Subject: | note 112183 deleted from function.array-reverse by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194921@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
<?php
$arr=array(1,2,3,4,5,6,7,8,9);
function ArrayRev($arr){
$a=count($arr);
for($i=$a-1;$i>=0;$i--){
$n[]=$arr[$i];
}
return $n;
}
print_r(ArrayRev($arr));
?>
//output Array ( [0] => 9 [1] => 8 [2] => 7 [3] => 6 [4] => 5 [5] => 4 [6] =>
3 [7] => 2 [8] => 1 )