Re: Escape characters won't go away

From: Date: Mon, 02 Sep 2002 03:32:37 +0000
Subject: Re: Escape characters won't go away
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-114869@lists.php.net to get a copy of this message
Thanks. I just figured it out myself. I had to change the expression: $string= ereg_replace("[\\]+", "", $string); The above is what worked. Mike "Justin French" <justin@indent.com.au> wrote in message news:B9991721.F33A%justin@indent.com.au... > on 02/09/02 1:14 PM, Mike Mannakee (mike@basementideas.com) wrote: > > > I'm getting multiple backslashes in data I get out of a mysql database. > > > > Example : > > > > ...Here\\\'s the d... > > > > No problem. Except I CANT GET RID OF THEM. I've tried several things: > > > > 1. $string = stripslashes($string); - Doesn't do anything > > have you tried: > > $string = stripslashes(stripslashes($string)); > // OR > $string = stripslashes(stripslashes(stripslashes($string))); > > For multiple occurrences, you have to call it twice... or even three times. > > > also try > > $string = str_replace("\'", "", $string); > $string = str_replace("\\", "", $string); > > > Justin French >

« previous php.general (#114869) next »