Re: in_array
| From: | David Otton | Date: | Thu, 13 Sep 2001 11:53:29 +0000 |
| Subject: | Re: in_array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67182@lists.php.net to get a copy of this message | ||
On Thu, 13 Sep 2001 14:17:12 +0300, you wrote:
>i wrote php scripts with php 4. but my server's php version is php 3. i
>used in_array function while i was writing the scripts. i used that
>function to check posted variables is available or not.
>is there an another way to check this posted variables or another one
>likes in_array function?
Straight from the manual:
http://www.php.net/manual/en/function.in-array.php
function in_array($needle,$haystack) {
for($i=0; $i<count($haystack) && $haystack[$i] !=$needle; $i++);
return ($i!=count($haystack));
}
djo