And here indeed I am again
I've quite happily managed to parse XML feeds and access the data and loop through it etc etc
But I'm now trying to build a php array from the xml that I can then merge with an existing array from a local MYSQL query
When my doubtless simpleton code as below runs
PHP Code:
$xml = simplexml_load_file('http://www.xml2u.com/Xml/Blue%20Square_1314/2389_Default.xml');
$Properties = $xml->xpath('Clients/Client/properties/Property');
//$xml = json_decode(json_encode((array) simplexml_load_file($xml)), 1);
$x=0;
foreach ($Properties as $Property)//immoblier
{
$Ref = $Property->category;
$Region = $Property->Address->region;
$Department = $Property->Address->subRegion;
$Town = $Property->Address->location;
$ClassifiedText = $Property->Description->description;
$AdTitle = $Property->Description->title;
$Area = $Property->Description->floorSize;
$Land = $Property->PlotSize->plotSize;
$Photo1 = $Property->images->image[1]->image;
$Photo2 = $Property->images->image[2]->image;
$Photo3 = $Property->images->image[3]->image;
$arrayBS=array(Ref=>$Ref,Region=>$Region,Department=>$Department,Town=>$Town,ClasifiedText=>$ClassifiedText,AdTitle=>$AdTitle,Area=>$Area,Land=>$Land,Photo1=>$Photo1,Photo2=>$Photo2,Photo3=>$Photo3);
$x++;
}
print_r($arrayBS);
What on earth am I not doing right?
The xml file is as below in case it's not normal
http://www.xml2u.com/Xml/Blue%20Squa...89_Default.xml
yesterday I could create an array, today only a error
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "" in /home/rauxvsuj/public_html/ClassifiedXML.php on line 175
sorry, I'm frazzled and confused and would love someone to squint at the xml feed and point in the right direction to create a nice and easy php array, from there I can do it