3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function _getYoutubeVideoId($url) { if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $url, $match)) { return $match[1]; } } var_dump(_getYoutubeVideoId("http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/WQq0RAbj4i8"));
based on 6jnoq
Output for 4.3.0 - 7.1.0
string(11) "WQq0RAbj4i8"