Re: stripslashes

From: Date: Mon, 05 Feb 2001 18:04:01 +0000
Subject: Re: stripslashes
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-66@lists.php.net to get a copy of this message
You don't really have to make a smarty_mod_function for this, just call the php function directly: {$text|stripslashes} Of course if you really wanted to shorten the name to sslashes, then you do have to write your wrapper like you did below. taliku@balcab.ch wrote: > > Hi! > > 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} > > but i didn't worked. > > So i tried to add to Smarty.addons.php following: > > function smarty_mod_sslashes($string) > { > return stripslashes($string); > } > > and edit custom_mods to > > 'sslashes' => 'smarty_mod_sslashes', > > it didn't worked too. > > 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? > > Thanks in advance > taliku > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at ±òx:×éÄL > ]è´yù3http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

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