cvs: phpdoc /en/functions array.xml

From: Date: Sun, 07 Jan 2001 23:32:24 +0000
Subject: cvs: phpdoc /en/functions array.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333474@lists.php.net to get a copy of this message
derick Sun Jan 7 15:32:24 2001 EDT Modified files: /phpdoc/en/functions array.xml Log: Clarification of the strict parameter of in_array Index: phpdoc/en/functions/array.xml diff -u phpdoc/en/functions/array.xml:1.46 phpdoc/en/functions/array.xml:1.47 --- phpdoc/en/functions/array.xml:1.46 Tue Dec 12 20:51:17 2000 +++ phpdoc/en/functions/array.xml Sun Jan 7 15:32:24 2001 @@ -1753,6 +1753,7 @@ <funcdef>bool in_array</funcdef> <paramdef>mixed <parameter>needle</parameter></paramdef> <paramdef>array <parameter>haystack</parameter></paramdef> + <paramdef>bool <parameter>strict</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -1760,6 +1761,12 @@ <parameter>needle</parameter> and returns true if it is found in the array, false otherwise. </para> + <para + If the third parameter <parameter>strict</parameter> is set to + <literal>TRUE</literal> then the <function>in_array</function> + will also check the types of the <parameter>needle</parameter> + in the <parameter>haystack</parameter>. + </para> <para> <example> <title><function>In_array</function> example</title> @@ -1768,6 +1775,25 @@ if (in_array ("Irix", $os)){ print "Got Irix"; } + </programlisting> + </example> + </para> + <para> + <example> + <title><function>In_array</function> with strict example</title> + <programlisting role="php"> +<?php +$a = array('1.10', 12.4, 1.13); + +if (in_array('12.4', $a, true)) + echo &quot;'12.4' found with strict check\n&quot;; +if (in_array(1.13, $a, true)) + echo &quot;1.13 found with strict check\n&quot;; +?> + +// This will output: + +1.13 found with strict check </programlisting> </example> </para>

« previous php.doc (#969333474) next »