At 4:31 PM -0400 3/14/11, Paul M Foster wrote:
Here's what I need to do: I have an indexed array, from which I need to delete elements in the middle. Once completed, the indexes should be numerically in sequence, as they were when I first encountered the array. That is: Before: $arr = array(0 => 5, 1 => 6, 2 => 7, 3 => 8, 4 => 9, 5 => 10); After: $arr = array(0 => 5, 1 => 6, 2 => 9, 3 => 10); I've tried: 1) Using for() with unset(). Elements are deleted, but the indexes are no longer sequential.
Try shuffle() -- that will assign new indexes to the new array. Cheers, tedd -- ------- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php