0

OK, so this webpage does things different. It uses text files and loads the data in JavaScript and then displays it in JavaScript. I tried using PHP methods but I can't get it.

How do I get the S array of player hiscores from http://queville.com/cgi-bin/forums/index.cgi?a=scores&b=Overall

Like, if you view the source, you'll see this between <script> </script> tags:

 S[na]="|Daminion|442776|30436|125645|90728|40835|79058|16318|15927|43700|129|0|"; na++; 
 S[na]="|superfly|442490|32398|32032|161903|93689|75086|20018|11020|15937|407|0|"; na++; 
 S[na]="|GodessCrystal|435702|46422|41721|95881|43717|105026|23324|23500|30296|25815|0|"; na++; 
 S[na]="|grandkool|432065|110849|34644|12438|7706|165145|60924|12436|23446|4477|87|"; na++;

I've tried using PHP's file_get_contents and like but it doesn't work...

2
  • What do you get when you use file_get_contents (and "like")? Commented Mar 30, 2013 at 3:05
  • I get blank results... try it yourself. >_< Commented Mar 30, 2013 at 3:06

1 Answer 1

1

Works for me:

$x = file_get_contents("http://queville.com/cgi-bin/forums/index.cgi?a=scores&b=Overall");
preg_match_all("/S\[na\]=.+/", $x, $matches);
print_r($matches);

Output:

Array
(
    [0] => S[na]="|popatop|7210055|1040749|495318|1691275|958880|1084535|401043|535678|163810|838767|1399|"; na++; 
    [1] => S[na]="|SusieQ|6102424|1047948|484290|934258|613093|1222478|344052|515099|109392|831814|253|"; na++;
    // lots more
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.