For more information about the code obtained from an address, see Post solution.

Source: Internet
Author: User
For more information about the code obtained from an address, see the post. for example, if the video address of Tudou is: js.tudouui.combinplayer2olc_8.swf after direct access by ghost? For more information about the codes obtained from iid131686432 & am, see the post.
For example, potato video address: http://www.tudou.com/a/OpofdZOE_mI/&iid=131686432&resourceId=0_04_05_99/v.swf
After direct access:
http://js.tudouui.com/bin/player2/olc_8.swf?iid=131686432&swfPath=http://js.tudouui.com/bin/lingtong/SocialPlayer_79.swf&youkuId=XNjc0MTE5MDky&vcode=XNjc0MTE5MDky&tvcCode=-1&tag=null&title=%E7%AC%AC07%E8%AF%9D+%E8%80%8D%E9%98%B4%E9%99%A9%E2%80%A6%E2%80%A6%21%21&mediaType=vi&totalTime=1434760&hdType=3&hasPassword=0&nWidth=512&isOriginal=0&channelId=9&nHeight=288&banPublic=false&videoOwner=102599789&tict=2&tvcCode=-1&channelId=9&cs=6_480|482&k=&totalTime=1434760&panelRecm=http://css.tudouui.com/bin/lingtong/PanelRecm_9.swz&panelDanmu=http://css.tudouui.com/bin/lingtong/PanelDanmu_1.swz&panelEnd=http://css.tudouui.com/bin/lingtong/PanelEnd_11.swz&pepper=http://css.tudouui.com/bin/binder/pepper_17.png&panelShare=http://css.tudouui.com/bin/lingtong/PanelShare_7.swz&panelCloud=http://css.tudouui.com/bin/lingtong/PanelCloud_8.swz&prd=&autoPlay=false&listType=3&rurl=&resourceId=0_04_05_99&autostart=false&lid=0&aid=228258&aCode=OpofdZOE_mI&code=JH-1K_odtwE&snap_pic=http%3A%2F%2Fr1.ykimg.com%2F054104085301E3696A0A4F52041D537C&aopRate=0.001&p2pRate=0.95&adSourceId=81000&yjuid=1392279724827k3i&yseid=1392887009649TQcVcx&yseidtimeout=1392898462767&yseidcount=4&uid=null&juid=018h4v26uu19ca&vip=0
How can I use PHP to obtain the Accessed address and output it?
------ Solution --------------------
$url='http://www.tudou.com/a/OpofdZOE_mI/&iid=131686432&resourceId=0_04_05_99/v.swf';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_exec($ch);

$response = curl_exec($ch);

preg_match_all('/^Location:(.*)$/mi', $response, $matches);
curl_close($ch);

echo !empty($matches[1]) ? trim($matches[1][0]) : 'No redirect found';

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.