Re: note 9873 added to str_replace

From: Date: Wed, 29 Nov 2000 05:52:40 +0000
Subject: Re: note 9873 added to str_replace
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-8207@lists.php.net to get a copy of this message
marc@wvmt.com writes: > It seems that PHP4 escapes single quotes in incoming strings for you for easy insertion into > sql databases. Pretty neat feature unless you're upgrading from PHP3. To get it to work in > both versions, escape twice like this: > > $text = str_replace ("\\", "", $text); > $text = str_replace ("'", "\'", $text); > > http://www.php.net/manual/function.str-replace.php Thanks for the note, but I've deleted it. This feature was also available in PHP 3; check your magic_quotes setting in php3.ini. -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+

« previous php.notes (#8207) next »