html - PHP XML fast read -
i load more 50 xml files on homepage. example structure can see here:
http://api.eve-central.com/api/marketstat?usesystem=30000142&hours=24&typeid=3683&minq=10000
i need price "sell" -> "min". run foreach()
loops , stop when got it. page needs more 30 seconds handle this, think need direct entry data like:
$min = $xml -> children() -> children() -> sell -> min;
can give me right arithmetik?
thx step
use simplexml_load_file
function. , quick!
$xml = simplexml_load_file('http://api.eve-central.com/api/marketstat?usesystem=30000142&hours=24&typeid=3683&minq=10000'); echo $xml->marketstat->type->sell->min; // 257.99
and simplexmlelement
, file_get_contents
$xml_str = file_get_contents('http://api.eve-central.com/api/marketstat?usesystem=30000142&hours=24&typeid=3683&minq=10000'); $xml = new simplexmlelement($xml_str); echo $xml->marketstat->type->sell->min; // 257.99
Comments
Post a Comment