$kod='<iframe src="http://vk.com/video_ext.php?oid=201397792&id=164928464&hash=3c5ea261f02bbf69&hd=1" width="580" height="360" frameborder="0"></iframe>';
iki koşulda lazım bana çünkü
<iframe frameborder="0" width="580" height="360" src="http://www.dailymotion.com/embed/video/xyrwjy"></iframe>
şeklinde ve bunun gibi "<" ile başlayan çok fazla $kod değişkenine tanımlı değer var.
benim yapmak istediğim her iki koşulda gerçekleşsin ama vk.com için olan çalışmıyor. ilkini alıyor.
else ile bir başka koşul oldugu için else yi almadım.
if(eregi("<",$kod)) {
$basla = array('/height="([0-9]+)"/','/width="([0-9]+)"/','/height=([0-9]+)/','/width=([0-9]+)/','/height:([0-9]+)/','/width:([0-9]+)/');
$bitir = array('height="'.$height.'"','width="'.$width.'"','height="'.$height.'"','width="'.$width.'"','height:'.$height,'width:'.$width);
$kod = preg_replace($basla,$bitir,$kod,-1);
return $kod;
}
if(eregi("vk.com",$kod)){
preg_match('#src=\"http:\/\/vk.com\/(.*?)\"#si',html_entity_decode($kod),$bul);
foreach($bul as $sayi){
$sayi = 'vk.com%2F'.urlencode($sayi);
}
$embed = ' '.$sayi.' ';
return $embed;
}elseif ile çözdüm arkadaşlar teşekkürler.