faceless105
n00b
- Joined
- Jun 26, 2006
- Messages
- 37
this may sound kinda n00bish but i cannot figure out why my preg_replace function is not working. I'll be honest and i'm not up to par with all the different string formatting options, so i think thats the problem i'm having.
i've gotten tested everything and ti works up to this point. the problem is in my preg_replace but i cant find it, anyone see anything wrong with this?
I've added a youtube insert function in my site, this parses the bbc code and replaces it with the youtube video code
i've gotten tested everything and ti works up to this point. the problem is in my preg_replace but i cant find it, anyone see anything wrong with this?
PHP:
$pattern = '/\[youtube\](.*?)\[\/youtube\]/is,';
$replacement = '<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/'.$stringVid.'"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/'.$stringVid.'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object>';
$str2 = preg_replace($pattern, $replacement, $str2, 1); // replace each individual occurance
I've added a youtube insert function in my site, this parses the bbc code and replaces it with the youtube video code