Re: trouble with array_search

From: Date: Sat, 30 Aug 2003 17:15:47 +0000
Subject: Re: trouble with array_search
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-161258@lists.php.net to get a copy of this message
thank you for your help. I have found that the error was laying somewhere else. The code like you wrote was ok. Cheers, merlin Catalin Trifu wrote:
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 (#161258) next »