Re: stripslashes()

From: Date: Sun, 02 Mar 2003 00:55:31 +0000
Subject: Re: stripslashes()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137735@lists.php.net to get a copy of this message
At 01:48 02.03.2003, Dade Register said: --------------------[snip]-------------------- >I know this is probably an easy question, but I am >using stripslashes() on a textarea var, and I don't >think it's working. It doesn't error, but in the >testarea it doesn't seem to work. Ex: > >$var = "Thank's"; >$var = stripslashes($var); >echo $var; >Output = Thank\'s --------------------[snip]-------------------- This can't work since there are no slashes to strip... stripslashes() strips certain slashes from a string. Assume you have a textarea where the user enters "Thank's", so PHP converts this to "Thank\'s" (assuming magic_quotes is set to on). Using stripslashes() here will get rid of these slashes. BTW - the sample you've sent will output "Thank's" - what are you doing what you didn't show? -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#137735) next »