Re: Suggested change for array_filter
| From: | Philip Olson | Date: | Wed, 30 Apr 2003 01:02:46 +0000 |
| Subject: | Re: Suggested change for array_filter | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969352963@lists.php.net to get a copy of this message | ||
On Fri, 25 Apr 2003, Joey Smith wrote:
> My writing abilities aren't very good, but I'm fairly unhappy
> with the current documentation for array_filter, so I'm going
> to propose a general direction the page might take and then
> hope that someone with some actual ability to write will step
> up and deliver the goods. If not, I'm sure I'll get around to
> it at some point.
>
> ---------------------------------------------------------------
> array_filter iterates over the values stored in input, passing
> them to the callback function. The current value will be copied
> to the result array if function returns true.
>
> If the input is an associative array the keys are preserved.
> ---------------------------------------------------------------
>
> The general idea being to document:
> 1) 'callback' will be iteratively passed one argument, the
> value of the current array index.
>
> 2) If callback returns true, the value of the current array
> index will be copied into the result array.
Here's a stab:
<function>array_filter</function> iterates over each value in
the <parameter>input</paramter> array passing them to the
<parameter>callback</parameter> function. If the <parameter>
callback</parameter> function returns true, the current
value from <parameter>input</paramter> is returned into the
result array. Array keys are preserved.
Regards,
Philip