Remove Magic Quotes


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function _strip_quotes(&$var) {
  2. if (is_array($var)) {
  3. array_walk($var, '_strip_quotes');
  4. } else {
  5. $var = stripslashes($var);
  6. }
  7. }
  8.  
  9. foreach (array('GET','POST','COOKIE') as $v) {
  10. if (!empty(${"_".$v})) { array_walk(${"_".$v}, '_strip_quotes'); }
  11. }
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.