Guest User

Untitled

a guest
Aug 16th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. $search = '/\<a(.+)href="https:\/\/(.+)(?:www\.)?((?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch(.+)v=))([\w\-]{10,12})).youtube\"(.+)<\/a>/i';
  2. $replace = '<iframe width="250" height="150" src="http://www.youtube-nocookie.com/embed/$5"></iframe>';
  3. $content = preg_replace($search, $replace, $content);
Advertisement
Add Comment
Please, Sign In to add comment