PDA

View Full Version : Extract database code



edhan
09-22-2007, 02:11 AM
Hi

I am trying to extract YouTube code instead of the entire embedded code from my database.



<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/r6wdq5vStms"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/r6wdq5vStms" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>


How can I extract this code : http://www.youtube.com/v/r6wdq5vStms

Any help is greatly appreciated. Thanks!

edhan
09-24-2007, 04:31 AM
Hi

I have managed to resolve this by:



$code = $results['extcode'];
preg_match('(src=[\"a-z:\/\.\?=\-0-9A-Z_\"]*)',$code,$results);
$src = substr($results[0],5,strlen($result[0])-1);



hope this will help those who are in the same situation.

Thanks!