2011-06-23 25 views

回答

0

你可以使用方法:

$subject = '<iframe width=\"425\" height=\"349\" src=\"http://www.youtube.com/embed/YRUG-Pu7RzE\" frameborder=\"0\" allowfullscreen></iframe>'; 
$pattern = '!http://(?:www.)?youtube.com/embed/([^"']+)!i'; 
$result = preg_match($pattern, $subject, $subpattern); 

$子模式将包含:

Array ([0] => http://www.youtube.com/embed/YRUG-Pu7RzE [1] => YRUG-Pu7RzE) 
+0

我不是高兴的语法突出。这可以改善吗? – Leif

相关问题