Last active
September 7, 2015 06:24
-
-
Save chinghanho/2390033878840dd1a842 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://vimeo.com/71673549'; | |
preg_match('/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/', $url, $matches); | |
?> | |
<iframe src="http://player.vimeo.com/video/<?php echo $matches[2] ?>?title=0&byline=0&portrait=0&badge=0&color=ffffff" width="640" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://www.youtube.com/watch?v=wg6170SSrOM'; | |
preg_match('/[\\?\\&]v=([^\\?\\&]+)/', $url, $matches); | |
?> | |
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $matches[1] ?>" frameborder="0" allowfullscreen></iframe> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment