HuyPV
Wednesday, March 23, 2011
 
 
$u = 'http://hn.nhac.vui.vn/tinh-yeu-hoa-gio-truong-the-vinh-m199202c3p6443a15261.html';
preg_match('@-m([0-9]+)@', $u, $m);
$id = $m[1];
$context = stream_context_create(array(
  'http' => array(
    'method'  => 'GET',
    'header'  => 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15',
    'timeout' => 5,
  ),
));
$source = file_get_contents('http://hn.nhac.vui.vn/asx2.php?type=1&id=' . $id, false, $context);
if ($source === false) return;
echo preg_match('@(http://www.+?)]]@', $source, $m) ? $m[1] : '???';
 Title: 
file_get_contents with context
Description:
 Title: 
file_get_contents with context
Description: 
$u = 'http://hn.nhac.vui.vn/tinh-yeu-hoa-gio-truong-the-vinh-m199202c3p6443a15261.html';  preg_match('@-m([0-9]+)@', $u, $m)...
                        ...
                        
Rating: 
                          4