Quote:
|
Originally Posted by nmcog
I'm trying to create a small PHP script that reads an XML file and extracts the value of an attribute (if that makes sense)
Example:
XML file: http://data.alexa.com/data?cli=10&da...ckyourself.com
The part I'm looking for is this one: <REACH RANK="4582"/>
The script is supposed to output "4582" but nothing is working and its 6:17am
Please 
|
If you only want that one part there is not need to really parse the XML..
PHP Code:
$data = file_get_contents("http://data.alexa.com/data?cli=10&dat=snbamz&url=www.gofuckyourself.com");
ereg("REACH RANK=\"([0-9]+)",$data,$regs);
echo $regs[1];
replace hahaha91; with [
that should do it..