Skip to main content

AccessTr.neT


Youtube Iframe Video Kodunu <Amp-Youtube Koduna Çevirme

Youtube Iframe Video Kodunu <Amp-Youtube Koduna Çevirme

#1
Epey uğraştırdığı için paylaşmak istedim.

PHP Kod:
$html preg_replace('/<iframe width="(.*)" height="(.*)" src="\/\/www.youtube.com\/embed\/(.*)" frameborder="0" allowfullscreen>\<\/iframe>/''<amp-youtube width="480" height="270" layout="responsive" data-videoid="$3"></amp-youtube>'$html); 

Örnek sayfa: https://accesstr.net/konu-alt-form-ust-f...derme.html
Amp Sayfa: https://accesstr.net/amp/konu-76818.html
Cevapla
#2
Güncel kod

PHP Kod:
$html preg_replace('/<iframe src="https:\/\/www.youtube.com\/embed\/(.*?)" (.*)><\/iframe>/''<amp-youtube width="480" height="270" layout="responsive" data-videoid="$1"></amp-youtube>'$html); 
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da