I'm pulling data from an XML file using the following code:
<?php
$url = 'http://www.inveroak.com/readerimages/livepanel/91221.xml';
$xml = simplexml_load_file($url);
$items = array();
$exclude = array('4419','4373');
$items = array_diff($items, $exclude);
foreach($xml as $Reader) {
$items[] = $Reader;
}
usort ($items, function($a, $b) {
return strcmp($a->Status,$b->Status);
});
foreach($items as $Reader) {
if($Reader->Status != 'Logged Off' && $Reader->Picture != 'None')
{
include '/extras/reader-single.php';
}
}
?>
The two lines showing $exclude and $items I've added afer seeing another post excluding values from a foreach loop about excluding from XML, but when i load the page.. the two records that have the PINs specified, are still showing.
Is this the correct way to exclude pulling certain records from an XML file?
Any help is greatly appreciated!
EDIT: The four digit numbers entered are a PIN number found at Reader->PIN After thinking, could it be that it's not making the link between the number and the Reader->PIN on the xml file?