Skip to content

Instantly share code, notes, and snippets.

View slouma2000's full-sized avatar
🐝
Venven

Slim OUICHTATI slouma2000

🐝
Venven
  • MAKE IT DIGITAL TUNISIA
  • TUNISIA
View GitHub Profile
(function(){
})()
#-----------------------
# robots.txt
#-----------------------
user-agent: *
disallow: /img/
disallow: /css/
disallow: /js/
disallow: /integ/
disallow: /captcha/
disallow: /admin/
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
@slouma2000
slouma2000 / jsAddSlashes
Created April 16, 2013 22:07
jsAddSlashes
function jsAddSlashes($str) {
$pattern = array(
"/\\\\/" , "/\n/" , "/\r/" , "/\"/" ,
"/\'/" , "/&/" , "/</" , "/>/"
);
$replace = array(
"\\\\\\\\", "\\n" , "\\r" , "\\\"" ,
"\\'" , "\\x26" , "\\x3C" , "\\x3E"
);
return preg_replace($pattern, $replace, $str);