note 107744 added to function.preg-replace
| From: | gjarrige at six-axe dot fr | Date: | Thu, 01 Mar 2012 09:55:23 +0000 |
| Subject: | note 107744 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186445@lists.php.net to get a copy of this message | ||
to drop some "dangerous" characters that cause a crash in DB2 databases, you can use that
technique :
preg_replace('/[^\x09\x0A\x0D\x20-\x7F\xC0-\xFF]/', '', $str);
I found this very effective technique in a very good page from Sitepoint (complete the sitepoint.com
url with the string "character-encodings-and-input" to find the page).
----
Server IP: 195.221.21.36
Probable Submitter: 212.155.199.228
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/107744
Del: integrated -- https://master.php.net/note/delete/107744/integrated
Del: useless -- https://master.php.net/note/delete/107744/useless
Del: bad code -- https://master.php.net/note/delete/107744/bad+code
Del: spam -- https://master.php.net/note/delete/107744/spam
Del: non-english -- https://master.php.net/note/delete/107744/non-english
Del: in docs -- https://master.php.net/note/delete/107744/in+docs
Del: other reasons-- https://master.php.net/note/delete/107744
Reject -- https://master.php.net/note/reject/107744
Search -- https://master.php.net/manage/user-notes.php