Voting

: two plus zero?
(Example: nine)

The Note You're Voting On

rmondragon at gmail dot com
19 years ago
In a previous example ...
<?php
function array_trim ( $array, $index ) {
if (
is_array ( $array ) ) {
unset (
$array[$index] );
array_unshift ( $array, array_shift ( $array ) );
return
$array;
}
else {
return
false;
}
}
?>

This have a problem. if u unset the last value and then use
<?
array_unshift ( $array, array_shift ( $array ) );
?>

will return a : Array ( [0] => )
so u can fix it using...

<?php
if (count($array) > 0) array_unshift ( $values, array_shift ( $values ) );
?>

good luck ;)

<< Back to user notes page

To Top