Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # <a href="https://youtu.be/llGF8G0BpfA.youtube" target="blank" rel="nofollow">https://youtu.be/llGF8G0BpfA.youtube</a>
- $search = '#<a ?(?:href="https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch?.*?v=))([\w\-]{10,12}).youtube<\/a>#x';
- #$search = '#<a(.*?)(?:href="https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch?.*?v=))([\w\-]{10,12}).youtube<\/a>#x';
- $replace = '<iframe width="250" height="150" src="http://www.youtube-nocookie.com/embed/$2"></iframe>';
- $content = preg_replace($search, $replace, $content);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement