示例:在此域http://www.example.com/234234/go.html只有一个 iframe-code
如何在 iframe 代码中获取 url?
去.html:
<iframe style="width: 99%;height:80%;margin:0 auto;border:1px solid grey;" src="i want this url" scrolling="auto" id="iframe_content"></iframe>
我有这个片段,但它的编码很糟糕..
function downloadlink ($d_id)
{
$res = @get_url ('' . 'http://www.example.com/' . $d_id . '/go.html');
$re = explode ('<iframe', $res);
$re = explode ('src="', $re[1]);
$re = explode ('"', $re[1]);
$url = $re[0];
return $url;
}
谢谢你!