[RESOLVED] Getting a sentence from a site?
I want to know how would I get a number from a sentence using file_get_contents and split? This is the code I'm using...
Code:
<?php
$rs = file_get_contents("http://www.runescape.com/title.ws");
list($rs) = split('There are currently', $rs);
echo "$rs";
?>
The sentence on the website is:-
There are currently random number people playing!
When I run the code it shows me the site and stops where the sentence is and just shows the letters "There" whats wrong with the code?
Re: Getting a sentence from a site?
PHP Code:
<?php
$rs = file_get_contents("http://www.runescape.com/title.ws");
$pos = strpos($rs, 'There are currently');
$number = substr($rs, $pos + 20, 50);
$pos = strpos($number, ' people playing');
$number = substr_replace($number, '', $pos);
echo $number; //$number is the number...
?>
Re: Getting a sentence from a site?