more PHP help
Posted: Tue Mar 21, 2006 11:16 pm
http://bb.cinemasiafreaks.com/view/?tid=15#97
I have a part in the admin panel where I can set UBB tags if you will for smilies.
I simply comma seperate the different tags and put the smilie name and the tags as one long string into the DB, which takes one row as you might expect
in my forums etc the string needs to be exploded to determine the possible pseudonyms/ tags for a smilie in the DB (line 6+7)
for those images I have to create replacements to run through preg_replace(), which works fine (line 20)
however, the patterns also need to be dynamically generated, which is what kind of fails.
I need to escape certain characters in the pseudonyms, which I where I fail
basically it fails on smilies like: : ) and ; ) because of the ')', which needs to be escaped like '/:\)/'
this should happen on line 15
can someone tell me how I can insert a '\' before a ')' ????
should I just explode it, insert it and the put it back together?
I have a part in the admin panel where I can set UBB tags if you will for smilies.
I simply comma seperate the different tags and put the smilie name and the tags as one long string into the DB, which takes one row as you might expect
in my forums etc the string needs to be exploded to determine the possible pseudonyms/ tags for a smilie in the DB (line 6+7)
for those images I have to create replacements to run through preg_replace(), which works fine (line 20)
however, the patterns also need to be dynamically generated, which is what kind of fails.
I need to escape certain characters in the pseudonyms, which I where I fail
basically it fails on smilies like: : ) and ; ) because of the ')', which needs to be escaped like '/:\)/'
this should happen on line 15
can someone tell me how I can insert a '\' before a ')' ????
should I just explode it, insert it and the put it back together?