Note that the result array is non-sequential.

Patch contributed by Larry Garfield.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350489 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2020-09-02 16:28:21 +00:00
parent b899001091
commit fea06f18ec

View file

@ -19,7 +19,11 @@
passing them to the <parameter>callback</parameter> function.
If the <parameter>callback</parameter> function returns &true;, the
current value from <parameter>array</parameter> is returned into
the result &array;. Array keys are preserved.
the result &array;.
</para>
<para>
Array keys are preserved, and may result in gaps if the <parameter>array</parameter> was indexed.
The result &array; can be reindexed using the <function>array_values</function> function.
</para>
</refsect1>
@ -44,10 +48,9 @@
The callback function to use
</para>
<para>
If no <parameter>callback</parameter> is supplied, all entries of
<parameter>array</parameter> equal to &false; (see
<link linkend="language.types.boolean.casting">converting to
boolean</link>) will be removed.
If no <parameter>callback</parameter> is supplied, all empty entries of
<parameter>array</parameter> will be removed. See <function>empty</function>
for how PHP defines empty in this case.
</para>
</listitem>
</varlistentry>