QQ Space Flash Address use PHP to extract the Flash address code in the video site page

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.