RE: array_filter function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks You,
 
rgds, bnug

________________________________

From: Robin Vickery [mailto:robinv@xxxxxxxxx]
Sent: Jumat 28-Mar-2008 21:45
To: Bagus Nugroho
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  array_filter function



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";'));




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux