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 | |
/** | |
* quickYouTubeId: Easy little function to get the video ID from any YouTube | |
* URL. | |
* | |
* I went through a lot of snippets that perform various kinds of RegEx and | |
* parse_url and what not, but I thought, since most YouTube video IDs are 11 | |
* characters, why not just look for the only 11-character string and extract | |
* that? I can't think of a YouTube URL that'll foil this match. Can you? | |
* |