GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP XML Parsing Problem for Alexa Rank (https://gfy.com/showthread.php?t=449141)

nmcog 03-27-2005 10:17 PM

PHP XML Parsing Problem for Alexa Rank
 
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 :helpme

nmcog 03-28-2005 05:25 AM

bump.....

grumpy 03-28-2005 05:43 AM

stil looking?

mortenb 03-28-2005 05:51 AM

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 :helpme


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..

nmcog 03-28-2005 05:55 AM

Thanks, it works great :thumbsup :thumbsup

mortenb 03-28-2005 05:57 AM

no problem :)


All times are GMT -7. The time now is 11:09 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123