Skip to content

Instantly share code, notes, and snippets.

@hugowan
Created August 15, 2013 18:45
Show Gist options
  • Save hugowan/6243555 to your computer and use it in GitHub Desktop.
Save hugowan/6243555 to your computer and use it in GitHub Desktop.
<?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