我想得到
http:\/\/www.adorocinema.com\/_video\/iblogvision.aspx?cmedia=18638261&isApp=true
来自:
"trailerEmbed":"<div id='ACEmbed'><iframe src='http:\/\/www.adorocinema.com\/_video\/iblogvision.aspx?cmedia=18638261&isApp=true' style='width:480px; height:270px' frameborder='0' allowfullscreen='true'><\/iframe><br \/><a href=\"http:\/\/www.adorocinema.com\/filmes\/filme-109815\/\" target=\"_blank\">Pequena Miss Sunshine<\/a><\/div>"
如何? 感谢。
答案 0 :(得分:1)
你可以使用jquery来做到这一点:
var url = $("div#ACEmbed").find("iframe").attr('src');
如果您想在php中执行此操作,我认为以下代码可以正常工作:
$iframe = "<div id='ACEmbed'><iframe src='http:\/\/www.adorocinema.com\/_video\/iblogvision.aspx?cmedia=18638261&isApp=true' style='width:480px; height:270px' frameborder='0' allowfullscreen='true'><\/iframe><br \/><a href=\"http:\/\/www.adorocinema.com\/filmes\/filme-109815\/\" target=\"_blank\">Pequena Miss Sunshine<\/a><\/div>";
preg_match('/src="([^"]+)"/', $iframe, $match);
$url = $match[1];