added <function> in search_array() prototype.

TRUE/FALSE -> literal


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@41534 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Damien Seguy 2001-02-20 08:13:49 +00:00
parent 8d47e43d5d
commit e17bafd417

View file

@ -512,7 +512,8 @@ $result = array_merge_recursive ($ar1, $ar2);
SORT_REGULAR after before each new array argument.
</para>
<para>
Returns true on success, false on failure.
Returns <literal>TRUE</literal> on success, <literal>FALSE</literal>
on failure.
</para>
<para>
<example>
@ -761,7 +762,7 @@ print $input[$rand_keys[1]]."\n";
<function>Array_reverse</function> takes input
<parameter>array</parameter> and returns a new array with the
order of the elements reversed, preserving the keys if
<parameter>preserve_keys</parameter> is true.
<parameter>preserve_keys</parameter> is <literal>TRUE</literal>.
</para>
<para>
<example>
@ -769,7 +770,7 @@ print $input[$rand_keys[1]]."\n";
<programlisting role="php">
$input = array ("php", 4.0, array ("green", "red"));
$result = array_reverse ($input);
$result_keyed = array_reverse ($input, true);
$result_keyed = array_reverse ($input, TRUE);
</programlisting>
</example>
</para>
@ -1089,7 +1090,7 @@ array_unshift ($queue, "p4", "p5", "p6");
</funcprototype>
</funcsynopsis>
<para>
<function>Array_values</function> returns all the values from the
<function>array_values</function> returns all the values from the
<parameter>input</parameter> array.
</para>
<para>
@ -1466,15 +1467,15 @@ $result = count ($a);
array element that's currently being pointed by the internal
pointer. It does not move the pointer in any way. If the
internal pointer points beyond the end of the elements list,
<function>current</function> returns false.
<function>current</function> returns <literal>FALSE</literal>.
<warning>
<para>
If the array contains empty elements (0 or "", the empty
string) then this function will return false for these elements
as well. This makes it impossible to determine if you are
really at the end of the list in such an array using
<function>current</function>. To properly traverse an array
that may contain empty elements, use the
string) then this function will return <literal>FALSE</literal>
for these elements as well. This makes it impossible to
determine if you are really at the end of the list in such
an array using <function>current</function>. To properly
traverse an array that may contain empty elements, use the
<function>each</function> function.
</para>
</warning>
@ -1514,7 +1515,8 @@ $result = count ($a);
</para>
<para>
If the internal pointer for the array points past the end of the
array contents, <function>each</function> returns false.
array contents, <function>each</function> returns
<literal>FALSE</literal>.
</para>
<para>
<example>
@ -1765,7 +1767,7 @@ blue, large, sphere, medium
<refentry id="function.in-array">
<refnamediv>
<refname>in_array</refname>
<refpurpose>Return true if a value exists in an array</refpurpose>
<refpurpose>Return TRUE if a value exists in an array</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -1779,8 +1781,8 @@ blue, large, sphere, medium
</funcsynopsis>
<para>
Searches <parameter>haystack</parameter> for
<parameter>needle</parameter> and returns true if it is found in
the array, false otherwise.
<parameter>needle</parameter> and returns <literal>TRUE</literal>
if it is found in the array, <literal>FALSE</literal> otherwise.
</para>
<para>
If the third parameter <parameter>strict</parameter> is set to
@ -1806,9 +1808,9 @@ if (in_array ("Irix", $os)){
<?php
$a = array('1.10', 12.4, 1.13);
if (in_array('12.4', $a, true))
if (in_array('12.4', $a, TRUE))
echo &quot;'12.4' found with strict check\n&quot;;
if (in_array(1.13, $a, true))
if (in_array(1.13, $a, TRUE))
echo &quot;1.13 found with strict check\n&quot;;
?>
@ -1827,13 +1829,15 @@ if (in_array(1.13, $a, true))
<refentry id="function.search-array">
<refnamediv>
<refname>search_array</refname>
<refpurpose>Searches the array for a given value and returns the corresponding key if successful</refpurpose>
<refpurpose>
Searches the array for a given value and returns the corresponding key if successful
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>mixed search_array</funcdef>
<funcdef>mixed <function>search_array</function></funcdef>
<paramdef>mixed <parameter>needle</parameter></paramdef>
<paramdef>array <parameter>haystack</parameter></paramdef>
<paramdef>bool <parameter>strict</parameter></paramdef>
@ -1842,7 +1846,7 @@ if (in_array(1.13, $a, true))
<para>
Searches <parameter>haystack</parameter> for
<parameter>needle</parameter> and returns the key if it is found in
the array, false otherwise.
the array, <literal>FALSE</literal> otherwise.
</para>
<para>
If the third parameter <parameter>strict</parameter> is set to
@ -2180,7 +2184,8 @@ Array
</funcsynopsis>
<para>
Returns the array element in the next place that's pointed by the
internal array pointer, or false if there are no more elements.
internal array pointer, or <literal>FALSE</literal> if
there are no more elements.
</para>
<para>
<function>Next</function> behaves like
@ -2189,13 +2194,13 @@ Array
element. That means it returns the next array element and
advances the internal array pointer by one. If advancing the
internal array pointer results in going beyond the end of the
element list, <function>next</function> returns false.
element list, <function>next</function> returns <literal>FALSE</literal>.
<warning>
<para>
If the array contains empty elements, or elements that have a key
value of 0 then this function will return false for these elements
as well. To properly traverse an array which may contain empty
elements or elements with key values of 0 see the
value of 0 then this function will return <literal>FALSE</literal>
for these elements as well. To properly traverse an array which
may contain empty elements or elements with key values of 0 see the
<function>each</function> function.
</para>
</warning>
@ -2247,14 +2252,14 @@ Array
</funcsynopsis>
<para>
Returns the array element in the previous place that's pointed by
the internal array pointer, or false if there are no more
the internal array pointer, or <literal>FALSE</literal> if there are no more
elements.
<warning>
<para>
If the array contains empty elements then this function will
return false for these elements as well. To properly traverse
an array which may contain empty elements see the
<function>each</function> function.
return <literal>FALSE</literal> for these elements as well.
To properly traverse an array which may contain empty elements
see the <function>each</function> function.
</para>
</warning>
</para>