Posted By

section31 on 07/06/08


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

SpinZ
jdstraughan


Remove Magic Quotes


 / Published in: PHP
 

  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
Posted By: section31 on July 6, 2008

You need to login to post a comment.