You are here:  » Filter out data


Filter out data

Submitted by aslater on Wed, 2009-05-13 13:39 in

Hello is it possible to filter out data based on a field i.e if $record["PROVIDERNAME"] = "TommyCooks" it is not shown. I have an xml file cached from an api. I would like to do it at the api side but its not possible.

Regards

Submitted by support on Wed, 2009-05-13 13:43

Hi,

Sure - you can do any comparison tests you like at the top of your myRecordHandler function and just "return;" from the function if any of the conditions are true. For example...

function myRecordHandler($record)
{
  if ($record["PROVIDERNAME"]=="TommyCooks") return;
  // ...continue with rest of function here...
}

Don't forget that you need to use double-equals - i.e. "==" for comparison in PHP, a single equals sign is an assignment operator...

Hope this helps!
Cheers,
David.

Submitted by aslater on Wed, 2009-05-13 13:53

Sorry I used to do a lot of ASP.

Yes this works great thank you.