Thread
:
[PHP] nasty double quotes and single quotes...
View Single Post
rufopr
2002-08-08 #
6
still nothing...
ok i tried what
snak9
suggested (since i know nothing about perl)
$thetext = "go to
ultrashock!
or [LINK]http://www.identd.org/[/link]";
preg_replace("s/\
(.*?)\[\/LINK\]/gi", "<a href=\"$1\">$2</a>", $thetext);
preg_replace("s/\[LINK\](.*?)\[\/LINK\]/gi", "<a href=\"$1\">$1</a>", $thetext);
print $thetext."\n";
after testing this is the error i get
Warning: Delimiter must not be alphanumeric or backslash in /usr/local/psa/home/vhosts/mysticspace.net/web_users/rufo/phpTests/ereg.php on line 11
Warning: Delimiter must not be alphanumeric or backslash in /usr/local/psa/home/vhosts/mysticspace.net/web_users/rufo/phpTests/ereg.php on line 12
go to
ultrashock!
or [LINK]http://www.identd.org/
what is s/ and /gi anyway? is that like ^ (beginning) and $ (end) on a ereg function?
oh and about the backslashes... stripslashes didn't work i've already tried it
like this
$thetext = "double quotes in my posts \"suck\"!";
$thetext = stripslashes($thetext);
print $thetext."\n";
and just got this printed
double quotes in my posts \"suck\"!
i'd appretiate if someone could clarify things for me
rufopr
View Public Profile
Visit rufopr's homepage!
Find all posts by rufopr