Re: stripslashes

From: Date: Mon, 05 Feb 2001 17:57:44 +0000
Subject: Re: stripslashes
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-65@lists.php.net to get a copy of this message
On Mon, 05 Feb 2001, taliku@balcab.ch wrote: > I want to replace all slashes with nothing. > I've tried to add in the Smarty.class.php the following line to custom_mods: > > 'sslashes' => 'stripslashes', > > and in my template: > {$text|sslashes} This worked for me. But I'm using the latest, as yet unreleased version of Smarty so... :) In the new version you'll be able to say: $smarty->register_modifier('sslashes', 'stripslashes'); Send me the piece of the compiled template that has call to sslashes and I'll take a look.. > Now i'm trying to replace the \ with nothing like this: > > {$text|replace:"\":""} > > but smarty says something about "missing argument 3". > Is the syntax of the "replace" function not correct? It's correct, but you have to use \\ instead of \. Smarty allows quoting of quotes themselves inside the strings, so \\ is necessary. -Andrei Windows 2000 is certified not to crash more than once a day, so what is the bootup time, 24 hours? -- Sam Liddicott

« previous php.smarty.general (#65) next »