11
1.942
<?php $url = 'http://www.livescore.com/default.dll'; $cookie_file_name = "/tmp/cookie.txt"; $curl = curl_init(); curl_setopt($curl, CURLOPT_COOKIEJAR, $cookie_file_name); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); $str = curl_exec($curl); unset($curl); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_name); curl_setopt($ch, CURLOPT_URL, $url); $buf2 = curl_exec($ch); curl_close($ch); $pos1 = '<tr bgcolor="#333333"><td class="title" colspan="4" height="18"> <b>'; $pos2 = '<tr bgcolor="#111111"><td colspan="4" height="4"></td></tr></table>'; $buf3 = substr($buf2, strpos($buf2, "$pos1")); $buf3 = substr($buf3, 0, strpos($buf3, "$pos2")); echo "$buf3"; ?>