Get Youtube address in PHP -


i have got forum written in php.

i need detect when posts youtube url , grab whole url/string.

any ideas ?

preg_match_all('/(http:\/\/www\.youtube\.com\/watch\?v=[^\s]*)/si', $str, $match_urls); 

this matches youtube video links.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -