/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Fetch an item from a global array. * * @param array array to search * @param string key to find * @param mixed default value * @param boolean XSS clean the value * @return mixed */ protected function search_array($array, $key, $default = NULL, $xss_clean = FALSE) { return $array; //$key = 'option[min][max][x]'; // patch: start { foreach ($subkeys as $key) { return $default; $array = $array[$key]; } return $array; } // end return $default; // Get the value $value = $array[$key]; if ($this->use_xss_clean === FALSE AND $xss_clean === TRUE) { // XSS clean the value $value = $this->xss_clean($value); } return $value; }
Comments
