PHP –– array manipulation
written by: admin
Date Written: 5/25/10
Last Updated: 5/25/10
Both of these will retrieve the second to last value of an array.
<?php
$arr=array("q","w","e","r","t");
echo $arr[count($arr)-2];
?>
<?php
$inversed = array_reverse($array);
$end = $inversed[1];
?>
See also
PHP –– sorting arraysTAGS: php