Skip to content

Instantly share code, notes, and snippets.

@Itachi261092
Created October 13, 2015 11:57
Show Gist options
  • Save Itachi261092/eab29b9922120880fb82 to your computer and use it in GitHub Desktop.
Save Itachi261092/eab29b9922120880fb82 to your computer and use it in GitHub Desktop.
[PHP] Youtube links parser / Парсер ютуб ссылок
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