Re: [PHP] array_filter function
- From: robinv@xxxxxxxxx ("Robin Vickery")
- Date: Fri, 28 Mar 2008 14:45:25 +0000
On 28/03/2008, Bagus Nugroho <bnugroho@xxxxxxxxxxxxxxx> wrote:
Hello,
If I have an array like this
$dataArray = array(0=>array('type'=>'da'), 1=>array('type'=>'wb'), 2=>array('type'=>'da');
How I can filtering to get only 'da' only, like this
$newDataArray = array(0=>array('type'=>'da'),2=>array('type'=>'da'))
$newDataArray = array_filter($dataArray, create_function('$a','return
$a["type"] == "da";'));
.
- Follow-Ups:
- RE: [PHP] array_filter function
- From: "Bagus Nugroho"
- RE: [PHP] array_filter function
- References:
- [PHP] Use of callback on a stream
- From: Olivier Dupuis
- array_filter function
- From: "Bagus Nugroho"
- [PHP] Use of callback on a stream
- Prev by Date: RE: [PHP] munge / obfuscate ?
- Next by Date: Re: character encoding
- Previous by thread: Re: [PHP] array_filter function
- Next by thread: RE: [PHP] array_filter function
- Index(es):