daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function post_array($table=NULL, $data=array(), $xss_clean = FALSE)
  2.     {
  3.         if(empty($data)) return FALSE;
  4.        
  5.         $fields = $this->fields($table);
  6.  
  7.         foreach ($data as $k => $v)
  8.         {
  9.             if(in_array($k, $fields) == FALSE)
  10.             {
  11.                 unset($data[$k]);
  12.             }
  13.             else
  14.             {
  15.                 if($xss_clean === TRUE)
  16.                 {
  17.                     $data[$k] = $this->input->xss_clean($v);
  18.                 }
  19.             }
  20.         }
  21.        
  22.         return $data;
  23.     }
  24.    
  25.     function fields($table=NULL)
  26.     {
  27.         return $this->db->list_fields($table);
  28.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top