> Not sure if there is a function that I missed when I did a search on this
> at php.net, but here is the situation:
>
> I have an array that looks something like this:
> 12:00:00
> 12:05:00
> 12:10:00
> 12:15:00
>
> Bascially, it just has all times in it for a day in 5 minute
> increments.  This is more of a template array for other things that I am
> doing.  How do I delete a specific time out of the array or how do I
delete
> a range of times out of the array?  I would like to be able to delete
> 12:05:00 but if I want, delete a range like 12:05:00 to 12:10:00.  I have
> other arrays that do NOT have numbers (times) in them and would like to be
> able to delete a specific item out of them too.

You can only delete elements from an array if you know the key of that
element. To delete it, you just use the unset() function.

unset($array['key']);

For your problem, though, I assume those are the "values" of the array,
right? You can either run a loop and go through every value of the array and
deleting it if it matches what you want, or use array_search() to find the
key of the value you're looking for and deleting it.

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to