function vk_video($code) { include_once('simple_html_dom.php'); $code_dom = str_get_html($code); $url_in = $code_dom->find('iframe', 0)->src; $html = file_get_html($url_in); $img = $html->find('#player_thumb', 0)->src; echo '<img alt="" src="'.$img.'" />'; }
подавать нужно ифрейм:
$vid = '<iframe src="http://vk.com/video_ext.php?oid=9214449&id=166118887&hash=375e7aca8b28dbc9&hd=1" width="607" height="360" frameborder="0"></iframe>'; vk_video($vid);