note 9873 deleted from str_replace by torben
| From: | torben@php.net | Date: | Tue, 28 Nov 2000 21:50:42 +0000 |
| Subject: | note 9873 deleted from str_replace by torben | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8206@lists.php.net to get a copy of this message | ||
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);