Zend - The PHP Company




Arrays

Add Code


Reverse Array  

Type: code fragment
Added by: tifao
Entered: 11/12/2000
Last modified: 01/12/2000
Rating: *** (3 votes)
Views: 5199
This is a function that reverses an array. For users that only have PHP 3.0 available.


<?php
function Reverter($a)
{
    
$temp = array();
    
$_asize sizeof($a);
    for(
$i 0$i $_asize$i++)
    {
        
$temp[$i] = $a[$_asize-$i-1];
    }

    return 
$temp;
}
?>


Usage Example




Rate This Script





Search



This Category All Categories