getting youtube video id the PHP
问题 I am currently writing a webapp in which some pages are heavily reliant on being able to pull the correct youtube video in - and play it. The youtube URLS are supplied by the users and for this reason will generally come in with variants one of them may look like this: http://www.youtube.com/watch?v=y40ND8kXDlg while the other may look like this: http://www.youtube.com/watch/v/y40ND8kXDlg Currently I am able to pull the ID from the latter using the code below: function get_youtube_video_id(