Created
August 15, 2013 18:45
-
-
Save hugowan/6243555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://t.hk.qq.com/index.php/u/janetchow0825'; | |
$agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_VERBOSE, true); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, $agent); | |
curl_setopt($ch, CURLOPT_URL,$url); | |
$result = curl_exec($ch); | |
// var_dump($result); | |
preg_match('/<div class=\"fright\">.*?<\/span>/s', $result, $matchs); | |
// var_dump($matchs); | |
echo trim(strip_tags($matchs[0])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment