This code is not working to server. But It is working to my localhost (xampp)
$url = file_get_contents('http://www.site.com/');
$xhtml='|<tr style="background-color:#dddddd;">
<td class="odd" align="left">(.+?)</td><td class="odd">(.+?)</td>
</tr>|i';
preg_match_all($xhtml,$url,$score);
array_shift($score);
echo"<pre>";
print_r($score);
echo"</pre>";
It prints another scores when I change the code like this. Because there are two rows like this. It has same codes. by the way below code works to server.
$xhtml='|<td class="odd" align="left">(.+?)</td><td class="odd">(.+?)</td>|i';
I need to take this two values between code.
allow_url_fopen = on
See Question&Answers more detail:os