|
Posted by Ivαn Sαnchez Ortega on 01/08/08 21:12
JP wrote:
> $retval = array_search($key,$keys);
> if ((int)$retval>=0) && (int)$retval<count($keys))
On failure, $retval is the boolean "false". You're casting it into an
integer, thus becoming 0 for purposes of the evaluation. As 0 >= 0, and 0
< count($keys), it doesn't work as you expect.
Now, go back to http://php.net/array_search and carefully read the warning
in the reddish box.
--
----------------------------------
IvΓ‘n SΓ‘nchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
Now listening to: De-Phazz - Daily Lama (2002) - [18] Style (4:51)
(97.222198%)
[Back to original message]
|