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><a href="https://www.youtu.be/llGF8G0Bpf.youtube" target="blank" rel="nofollow">PUT ANYTHING HERE</a><a href="https://www.youtu.be/llGF8G0BpfA.youtube" target="blank" rel="nofollow">PUT ANYTHING HERE</a>';
- $search = '/\<a(.+?)href="https:\/\/(www\.){0,1}((youtu\.be\/|youtube\.com(\/embed\/|\/v\/|\/watch(.+)v=){0,1})(.{10,12}))\.youtube"(.+?)<\/a>/i';
- $replace = '<iframe width="250" height="150" src="http://www.youtube-nocookie.com/embed/$7"></iframe>';
- $content = preg_replace($search, $replace, $content);
- print $content;
Advertisement
Add Comment
Please, Sign In to add comment