From d97896b3e4331d3411255f2f43938dd7684fb9ee Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 11 Jan 2002 13:18:50 +0000 Subject: [PATCH] - Added documentation/example for the use as an array as the first parameter to in_array(). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@67565 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/array.xml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/functions/array.xml b/functions/array.xml index 8d5018f68a..d1536713fc 100644 --- a/functions/array.xml +++ b/functions/array.xml @@ -1,5 +1,5 @@ - + Array Functions Arrays @@ -2886,6 +2886,12 @@ blue, large, sphere, medium a case-sensitive manner. + + + In PHP versions before 4.2.0 needle was not + allowed to be an array. + + <function>in_array</function> example @@ -2901,7 +2907,7 @@ if (in_array ("mac", $os)) { ]]> - The second condition fails because in_array() + The second condition fails because in_array is case-sensitive, so the program above will display: + + + <function>in_array</function> with an array as needle + + + +// This will output: + +'ph' is found +'o' is found +]]> + + + See also array_search.