using ' in an array

Started by cvdveer, September 10, 2007, 04:52:27 PM

Previous topic - Next topic

cvdveer

I searched the internet and tried several different regexp solutions but somehow it doesn't work.

Let me begin...
gwBBCode works like a charm. Only skills which include a ' in the name don't work (eg [Bull's Charge]). As a fix for it I received the following code which was taken from a similar site SMF + gwBBCode.


In Sources/Subs.php:

$message = strtr($message, array( ''' => '\''));
include('gwbbcode/gwbbcode.php');
$message = strtr($message, array('\'' => '''));


The code makes sense. Whenever I replace the ''' with anything else between the '' than a single or multiple ' it replaces that character successfully. But with the above code I get a totally blank page.

Is there anyone out there who has a clue?

Rudolf

You need to use double quotes or escape the single quote.
Your code gives error because ''' is not correct. It's not even clear what you want to do.

this works,, but all it does is to replace quotes with quotes.
$message = strtr($message, array( "'" => '\''));
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Advertisement: