RE: [PHP] array_filter function



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: [PHP] 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";'));





Relevant Pages

  • Re: [PHP] array_filter function
    ... How I can filtering to get only 'da' only, ... you could use array_valuesto re-index $newDataArray if you need to. ...
    (php.general)
  • Re: Need help on PHP for MPE/ix
    ... Here is the syntax of the dbupdate intrinsic in PHP: ... assoc array of item values) ... Please let me know if you have any more suggesstions to solve this problem. ... Pavan Kumar Rati wrote: ...
    (comp.sys.hp.mpe)
  • Re: Answers to some of your questions
    ... Also my probelm is in the way I have to do my filtering. ... through the filtering process a number of times and it can not be done all ... Then this new list needs to be placed into an array starting at 1 again ... At the possible cost of passing off one inefficiency to another potentially even higher cost one. ...
    (microsoft.public.vb.general.discussion)
  • Re: Using a RegEx as a "variable" WITHIN an array?
    ... believe the PHP one is also based upon. ... combination of 1 or more numerics in this instance would give you your ... add this to your array - you could then do a pattern match on the array ... > Dim selCriteria as String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Need help on PHP for MPE/ix
    ... If one item is an array, it must be declared as such in the list ... So, please show us the declaration of the record buffer, and its ... Of Pavan Kumar Rati ... Need help on PHP for MPE/ix ...
    (comp.sys.hp.mpe)