View Single Post
snaK9 snaK9 is offline 2002-08-08 #8 Old  
Last edited by snaK9 : 2002-08-08 at 10:28.
tested this and i'm not sure how robust it is, but it seems to work..

Code:
<?
$thetext = "go to ultrashock! or [LINK]http://www.identd.org/[/link]"; 
$thetext = preg_replace("/\[link=(.*?)\](.*?)\[\/link\]|\[link\](.*?)\[\/link\]/i", "<a href=\"$1$3\">$2$3</a>", $thetext);
echo $thetext; 
?>
use stripslashes like so:

Code:
<?
$quotes = "double quotes in my posts \"suck\"!";
echo stripslashes($quotes);
?>
Reply With Quote