/ Published in: PHP
Simple script to embed YouTube videos.
Expand |
Embed | Plain Text
<?php function embed_youtube ($url) { // split up string // clean parts if(stripos($parts['1'], 'www') !== false) { } // parse link switch($parts[1]) { case 'youtu.be': $video = $parts[2]; break; case 'youtube.com': foreach($qs as $value) { $qp[$qi[0]] = $qi[1]; } $video = $qp['v']; break; default: $video = FALSE; } // build embed string ?> <iframe width="560" height="349" frameborder="0" allowfullscreen> </iframe> <?php } ?>
You need to login to post a comment.
