Is there a way to cycle $this->input->post() items?

Answer

There are no CodeIgniter functions to do this, but you can accomplish this easily with a construct such as this one. The result of this function is a $safe_post_array that contains all posted data that has passed your own Input Class rules.

foreach (array_keys($_POST) as $key) {
$safe_post_array[$key] = $this->input->post($key);
}

You can also do something neat like this, if you want to pull all the data out of $_POST into your own array, cleaning it as it comes across:

$data['fields'] = xss_clean($_POST);

All CODEIGNITER Questions

Ask your interview questions on codeigniter

Write Your comment or Questions if you want the answers on codeigniter from codeigniter Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---