Re: trouble with array_search

From: Date: Sat, 30 Aug 2003 16:08:59 +0000
Subject: Re: trouble with array_search
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-161253@lists.php.net to get a copy of this message
Hi,
I printed the values out, and inserted it into a varibble to check if it finds it. In this case it works! But it only wokes if I do it like this: array('03042003'); This does not work: array(03042003);
When you make array(03042003) what you get is an array like this Array ( 0 => 3042003 ); PHP convers the string you got from date to an integer. So when adding the results from date() to the $dates array, you should keep them as strings. you could say $d = date('mdY', timestamp); $dates[] = "$d";//this will keep the variable added as string Cheers, Catalin

« previous php.general (#161253) next »