Hi people. I'm trying to put some info into an array from an xml sheet. the script will echo the results but I wont put them into the array comes up with the error "Warning: Illegal offset type in h:\SERVER\wamp\www\statbox\demo\demo2\viewstat.php on line 22"
thanks for anyhelp.
$xmlfile = "http://www.statbox.co.uk/demo/statinfo.xml";
function getarray($xmlfile) {
$xml = simplexml_load_file($xmlfile);
$endarray = array();
$loadarray = array();
$xmlnode = 0;
$end = 1;
while ($end == 1) {
$xmlhits = $xml->browser->browser[$xmlnode];
$xmlkey = $xml->browser->browser[$xmlnode]['name'];
if ($xmlhits != "") {
echo "<br>$xmlkey : $xmlhits";
$temparray = array($xmlkey => $xmlhits);
$loadarray = array_merge($loadarray, $temparray);
// $endarray = array_merge($endarray, $loadarray);
} else if ($xmlhits == "") {
print_r($loadarray);
$end++;
}
$xmlnode++;
}
}