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