I want to get all only youtube video ID from html code
look the (or multiple) object/embed code for youtube video
// html from database
&
I might get scolded for using a regex to parse html but given the circumstances maybe it's the best way to do it?
preg_match('~/v/([0-9a-z_]+)~i', $code, $matches); echo $matches[1];
assuming the valid characters for a youtube video id are 0-9a-z_