trouble with array_search
| From: | Merlin | Date: | Sat, 30 Aug 2003 15:23:38 +0000 |
| Subject: | trouble with array_search | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161246@lists.php.net to get a copy of this message | ||
Hi there,
I am having somee trouble with array_search.
The function should search for a given date, but it does not work since array_search seems only to compare strings. Thats why I tryed to cast it, but does not help.
Here is the problem:
(pseudo code)
while(...
$log[date][] = (string)date('mdY',$row->timestamp)
$date_search = '03042003';
$search = array_search($date_search, $dates);
if ($search !== NULL)
echo 'works';
it always returns 0
Thanx for any help on that,
Merlin