Duplicate dates in array
| From: | Dave Goodchild | Date: | Mon, 02 Apr 2007 12:43:13 +0000 |
| Subject: | Duplicate dates in array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-251921@lists.php.net to get a copy of this message | ||
Hi all, I have an array containing a sequence of dates in the following
format, for example:
Mon 26 Nov 2007
Mon 24 Dec 2007
Mon 31 Dec 2007
Mon 28 Jan 2007
...and I want to remove any the first element in cases where the Mondays
fall in the same month, so in this case I want to be
left with:
Mon 26 Nov 2007
Mon 31 Dec 2007
Mon 28 Jan 2007
Any ideas on the most efficient way to do it? I am working on using
combinations of array_search, in_array and so on and want to avoid regular
expressions if I can. Many thanks in advance for any suggestions!
--
http://www.web-buddha.co.uk