Page 1 of 1

Parsing Information

Posted: Sun Jul 23, 2006 10:05 pm
by SidewinderX
Ive already built an 'engine' that parses information from this website https://www.novaworld.com/Players/Stats ... 1&p=616065. In an effort to just get the script done i used any code that i could find that worked.

here is a snippet of my current code

Code: Select all

$url = "https://www.novaworld.com/Players/Stats.aspx?id=33680801261&p=616065";
$content = file_get_contents($url); 
$strip = strip_tags($content);
$remove = stristr($strip, 'Down');
$stats = $remove;
$pcid = stristr($stats, 'PCID:');
sscanf($pcid, 'PCID: %s' , $pcid);
echo "PCID: " . $pcid . "<br>";
essentially what the code above does is it gets the content of the url, strips the html, gets rid of all the information upto "Down" then starts parsing the data using scanf and storing it as a variable.

the code above gets the job done, but i was wondering if there any alternatives to get the job done that are maybe safer, faster, or better

im open to suggestions - thank you

Posted: Tue Jul 25, 2006 2:55 am
by RobertGonzalez
There has got to be a regex that can do that for you.