Created
October 13, 2015 11:57
-
-
Save Itachi261092/eab29b9922120880fb82 to your computer and use it in GitHub Desktop.
[PHP] Youtube links parser / Парсер ютуб ссылок
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
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) { | |
$video_id = $match[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment