note 54262 added to reference.pcre.pattern.syntax
| From: | bentglasstube at cox dot net | Date: | Tue, 28 Jun 2005 22:03:38 +0000 |
| Subject: | note 54262 added to reference.pcre.pattern.syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91103@lists.php.net to get a copy of this message | ||
I use the following function to escape things that need quotes unless they are already there:
<?php
function mysql_escape_magic($q)
{
$ugly = "\\\\'\\\"\\\x1a";
return preg_replace("/\\\\?([$ugly])/", "\\\\$1", $q);
}
?>
I can't get it to escape 0-bytes, though
----
Manual Page -- http://www.php.net/manual/en/reference.pcre.pattern.syntax.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54262
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54262&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54262&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54262&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54262&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54262&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54262&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54262&report=yes
Search -- http://master.php.net/manage/user-notes.php