Home > Article > Backend Development > QQ space flash address uses PHP to extract the code of the FLASH address in the video website page
Then I implemented this function using PHP. I think it is a pleasure to use PHP to do this work! Using the powerful HTML page processing functions and regular expressions it provides, you can accomplish this function in just a few lines of code.
Post the key code:
Copy the code The code is as follows:
//Get the flash address in the 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 );
?>
The above introduces the code of using qq space flash address to extract the FLASH address in the video website page using PHP, including the content of qq space flash address. I hope it will be helpful to friends who are interested in PHP tutorials.