如何从以下链接获取YouTube网址?
- <iframe title="YouTube video player" width="640" height="390"
- src="http://www.youtube.com/embed/VvJ037b_kLs"
- frameborder="0" allowfullscreen></iframe>
您可以使用正则表达式和preg_match函数
- preg_match('/src="([^"]+)"/',$iframe_string,$match);
- $url = $match[1];