Re: Escaping a double-quote problem

From: Date: Fri, 01 Feb 2002 17:11:54 +0000
Subject: Re: Escaping a double-quote problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83146@lists.php.net to get a copy of this message
Look up addslashes and stripslashes in the manual. Normally you'd use addslashes going into the db, and stripslashes coming out for display. HTH Joe :) "Anton Kolev" <akolev@hotmail.com> wrote in message news:20020201133237.3554.qmail@pb1.pair.com... > Any idea why when I print the value of $text, I get a backslash in front of > the result? > > $text=preg_replace("/\"/", "&quot;", $text); > $text=preg_replace("/\"/", "A", $text); > $text=str_replace("\"", "A", $text); > > Contrary: > > $text=preg_replace("/&/", "&amp;", $text); > > works quite well. > > cheerz > > >

« previous php.general (#83146) next »