RE: [PHP] stripslashes() not striping slashes

From: Date: Fri, 26 Oct 2001 21:07:27 +0000
Subject: RE: [PHP] stripslashes() not striping slashes
Groups: php.general 
Request: Send a blank email to php-general+get-72503@lists.php.net to get a copy of this message
Actually, After coding with PHP since the days me and bourbon shared a cube at Netvision while he developed php3 I think that's something I would know :) The funny issue is that only if I use double stripslashes does it work. e.g. $str = stripslashes($str); // This will NOT do the job. $str = stripslashes(stripslashes($str)); // This will do the job. This is the 1st time ever that I bumped into such a thing... any idea why? Any chance it has to do with the fact that I'm using <HTML DIR="RTL"> ? berber -----Original Message----- From: Rasmus Lerdorf [mailto:rasmus@php.net] Sent: Thursday, October 25, 2001 6:01 PM To: Boaz Yahav Cc: PHP General (E-mail) Subject: Re: [PHP] stripslashes() not striping slashes > Anyone has an idea why stripslashes(); doesn't strip slashes? > I have a form that when it's submitted with a ' sign ads slashes to the > submit results. > I'm taking the variable and sending it through stripslashes(); and yet > the slashes remain. You are perhaps thinking it does in-place modification of the argument? ie. stripslashes($a); echo $a; That's not how it works. It returns the stripped string. ie. $a = stripslashes($a); echo $a; -Rasmus

« previous php.general (#72503) next »