jwk811 Posted May 29, 2009 Share Posted May 29, 2009 <?php $url="http://www.youtube.com/watch?v=gUPduAbJpsU&videos=HsyjHLxVbwo&playnext_from=TL&playnext=1"; preg_match("/[v]\=[a-zA-Z]{0,20}/",$url,$match); $result=implode(' ',$match); echo $result; ?> that gets me this: gUPduAbJpsU BUT theres a problem. if there is a number in that part it will stop at the number and only give me part of what i need. what if i wanna get the video id from a link like this: PLEASE HELP!!! Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 29, 2009 Share Posted May 29, 2009 preg_match('#v=[^&]*#', $url, $match); Quote Link to comment Share on other sites More sharing options...
jwk811 Posted May 29, 2009 Author Share Posted May 29, 2009 preg_match('#v=[^&]*#', $url, $match); thank you! i love you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.