I'm not so sure about the title, will try to explain in the next lines.
I have an xml file like this :
<CAR park="3" id="1" bay="0"> <SITE_ID>0</SITE_ID> <SITE_NAME>Car Seller 1</SITE_NAME> . . . </CAR> I am sucessfully iterating through my xml to get all the data. But, I want to be able to filter by bays. I want to do something like
$xml = simplexml_load_file('myfile.xml'); $x = 1; foreach($xml as $car) { if($car->bay == '0'){ echo $car->SITE_ID; $x++; } }