Could someone give me help with parsing out Youtube ID from youtube embed code Input: <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/q_9cL9hfZs4"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/q_9cL9hfZs4" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object> Code (markup): Output: q_9cL9hfZs4 Code (markup):
nico_swd, if the function is putting the result into an array (which i think it is), wouldnt the first bit be addressed by 0, not 1?
$match[0] exists, but I believe it holds the entire result, while $match[1] holds the code (video ID) we actually want.