Re: note 11223 added to str_replace
| From: | Jesus M. Castagnetto | Date: | Sun, 11 Feb 2001 06:27:01 +0000 |
| Subject: | Re: note 11223 added to str_replace | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-10898@lists.php.net to get a copy of this message | ||
Have you checked if you have magic_quotes active in
your config?. This seems like a side effect of that
option in your php.ini (or httpd.conf).
Your note will be removed, as this is known effect and
it is mentioned in the "Configuration" section of the
manual.
set_magic_quotes_runtime() may help you.
If you do see this behavior even after turning off
magic_quotes in your config, it may be good to sumbit
it to bugs.php.net
--- dwight@wwwalker.com.au wrote:
> It inserts a backslash for you - weird sideeffect if
> you are doing mysql inserts - stuffs up inserts if
> you use:
>
> $fieldname = "18' doughboy pool";
>
> str_replace ("'", "''", $fieldname); /* two ' marks
> */
>
> -> $fieldname = "18\'' doughboy pool";
>
> which breaks INSERT in mysql
>
> Here is what works:
>
> $fieldname = "18' doughboy pool";
>
> str_replace("'", "'", $fieldname); /* one ' mark */
>
> -> $fieldname = "18\' doughboy pool";
>
>
>
http://www.php.net/manual/en/function.str-replace.php
>
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
php-list-admin@lists.php.net
=====
--- Jesus M. Castagnetto <jmcastagnetto@php.net>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/