how to delete array element with shifting the indexes ??
Posted: Tue Apr 22, 2008 4:23 am
hello forums!!
Can anybody suggest in the following case:
How to remove an element from an index array and reseting its indexes?
Example:
How to accomplish this ?
Thanks in advance for the suggestions.
Can anybody suggest in the following case:
How to remove an element from an index array and reseting its indexes?
Example:
Code: Select all
$array = array('x', 'y', 'z',..);
unset($array[1]);
print_r($array); // results: 0 => x, 2 => z ,which doesn't reset the indexes
// I would like to have the result as : 0 => x, 1 => z , ie rearraning the indexesThanks in advance for the suggestions.