Date: 01/07/01
- Next message: Rui Hirokawa: "[PHP-DOC] cvs: phpdoc /en/functions image.xml /ja/functions image.xml math.xml mcal.xml"
- Previous message: Jani Taskinen: "[PHP-DOC] cvs: phpdoc /en/functions image.xml"
- Next in thread: Rasmus Lerdorf: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Maybe reply: Rasmus Lerdorf: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Maybe reply: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 "'12.4' found with strict check\n";
+if (in_array(1.13, $a, true))
+ echo "1.13 found with strict check\n";
+?>
+
+// This will output:
+
+1.13 found with strict check
</programlisting>
</example>
</para>
- Next message: Rui Hirokawa: "[PHP-DOC] cvs: phpdoc /en/functions image.xml /ja/functions image.xml math.xml mcal.xml"
- Previous message: Jani Taskinen: "[PHP-DOC] cvs: phpdoc /en/functions image.xml"
- Next in thread: Rasmus Lerdorf: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Maybe reply: Rasmus Lerdorf: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Maybe reply: Egon Schmid: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

