Try this :
a [2] => c
$bar = array('a','b','c');
$piece = array_splice ($bar, 1 ,1);
print_r($piece); // [0] => b
print_r($bar);// [0] => a [1] => c
?>
http://www.php.net/manual/en/function.array-slice.php
http://www.php.net/manual/en/function.unset.ph
I have an array of search results which I am searching through and
unset()ing unwanted search results. My question is once I have unset a
result there is then a break in the numeric index and how do I stop this
from happening or reindex the results. Like this..
$results = array(0 => array(more el
2 matches
Mail list logo