Then I use PHP to achieve this function, I think PHP to do this work is a pleasure! With the powerful HTML page-handling functions and regular expressions that they provide, just a few lines of code can take care of this feature.
Paste the key code:
Copy the Code code as follows:
Get Flash address in Youku page
function Get_flash_url ($url)
{
$lines = file ($url);
foreach ($lines as $linenum = = $line) {
Preg_match_all (' || ', $line, $result);
$swfurl = $result [1][0];
if (!empty ($swfurl))
return $swfurl;
}
}
?>
$url =$_server["Query_string"];
$flashurl = Get_flash_url ($url);
Echo ($flashurl);
?>
For example, if we save this file as test.php, then we just need to run test.php. The URL of Youku video can parse out the flash address.
The idea is very simple, is to first look at Youku video page HTML code key flash address that segment of the feature. Find a Web page, for example, we can see this paragraph:
Flash Address:
Then use the regular expression to match the address segment in it, OK.
The above describes the QQ space flash address using PHP to extract the flash address of the video site page code, including the content of the QQ space Flash address, I hope that the PHP tutorial interested friends helpful.