PHP » PYTHON |
login |
register |
about
|
needle in haystack # example haystack = [1,5,6,3] needle = 6 if needle in haystack: print 'needle found' in_array(PHP 4, PHP 5) in_array — Checks if a value exists in an array DescriptionSearches haystack for needle . Parameters
Return ValuesReturns TRUE if needle is found in the array, FALSE otherwise. Changelog
Examples
Example #1 in_array() example
<?php The second condition fails because in_array() is case-sensitive, so the program above will display: Got Irix
Example #2 in_array() with strict example
<?php The above example will output: 1.13 found with strict check
Example #3 in_array() with an array as needle
<?php The above example will output: 'ph' was found 'o' was found
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|