note 86814 added to function.mysql-real-escape-string
| From: | phpdealer at gmail dot com | Date: | Tue, 04 Nov 2008 23:48:11 +0000 |
| Subject: | note 86814 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146142@lists.php.net to get a copy of this message | ||
<?php
/**
* Function to replicate mysql_real_escape_string
*
* @param string $text
* @return string
*/
function db_clean($text){
$replace = array(
"\x00" => '\x00',
"\n" => '\n',
"\r" => '\r',
'\\' => '\\\\',
"'" => "\'",
'"' => '\"',
"\x1a" => '\x1a'
);
return strtr($text, $replace);
}
----
Server IP: 209.41.74.194
Probable Submitter: 65.66.139.43
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/86814
Del: integrated -- https://master.php.net/note/delete/86814/integrated
Del: useless -- https://master.php.net/note/delete/86814/useless
Del: bad code -- https://master.php.net/note/delete/86814/bad+code
Del: spam -- https://master.php.net/note/delete/86814/spam
Del: non-english -- https://master.php.net/note/delete/86814/non-english
Del: in docs -- https://master.php.net/note/delete/86814/in+docs
Del: other reasons-- https://master.php.net/note/delete/86814
Reject -- https://master.php.net/note/reject/86814
Search -- https://master.php.net/manage/user-notes.php