Created
May 11, 2012 07:32
-
-
Save glagola/2658152 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mysql_escape_mimic($inp) | |
{ | |
if(!empty($inp) && is_string($inp)) { | |
return str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $inp); | |
} | |
return $inp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment