Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

mysql_real_escape_string() by hand

By: a guest on Mar 13th, 2012  |  syntax: PHP  |  size: 0.20 KB  |  hits: 70  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         $replace = array(
  2.                 "\x00"  => '\x00',
  3.                 "\n"    => '\n',
  4.                 "\r"    => '\r',
  5.                 '\\'    => '\\\\',
  6.                 "'"     => "\'",
  7.                 '"'     => '\"',
  8.                 "\x1a"  => '\x1a'
  9.         );
  10.         return strtr($string, $replace);