Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $r1 = '/^https?:\/\/(?:youtu\.be)\/([^?&#\/]+)/i';
- $r2 = '/^https?:\/\/(?:www\.youtube\.com)\/(?:watch)?[?&#\/]*?v=([^?&#\/]+)[?&#\/]*?/i';
- if(preg_match($r1, $this->link_youtube, $m) || preg_match($r2, $this->link_youtube, $m)){
- $this->link_youtube = 'http://www.youtube.com/embed/'.$m[1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement