Posted By

sb_01 on 10/12/10


Tagged


Versions (?)

clean up values


 / Published in: PHP
 

  1. private static $forbidden_chars = array("from","'","union","select","+","0x",">","<","\\","/","\"");
  2.  
  3. static function cleanUp($array) {
  4. if(is_array($array)) {
  5. foreach($array as $key => $value) {
  6. $array[$key] = self::replaceForbidden($value);
  7. }
  8. return $array;
  9. } else {
  10. return self::replaceForbidden($array);
  11. }
  12. }
  13.  
  14. static function replaceForbidden($str) {
  15. return str_replace(self::forbidden_chars, '', $str);
  16. }

Report this snippet  

You need to login to post a comment.