Thread: PHP Help
View Single Post
Old 07-15-2012, 08:19 PM  
Zoxxa
Confirmed User
 
Zoxxa's Avatar
 
Industry Role:
Join Date: Feb 2011
Location: Ontario, Canada
Posts: 1,026
Quote:
Originally Posted by kazymjir View Post
Code:
<?php
 
$str = "Remove this [tags]amateur, anal, teen,etc[/tags] stuff out of here!";
 
$regexp = "#\[tags\](.*?)\[/tags\]#is";
 
echo preg_replace($regexp, "", $str);
 
?>

I did not test this, but looks good to me.

I would also check out the explode() function after this and split it up using the comma delimiter into an array so you could then add each individual tag into a normalized DB.
__________________
[email protected]
ICQ: 269486444
ZoxEmbedTube - Build unlimited "fake" tubes with this easy 100% unencoded CMS!
Zoxxa is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote