CI_Input::get()

get([$index = NULL[, $xss_clean = NULL]])

Parameters:
  • $index (mixed) – GET parameter name
  • $xss_clean (bool) – Whether to apply XSS filtering
Returns:

$_GET if no parameters supplied, otherwise the GET value if found or NULL if not

Return type:

mixed

This method is identical to post(), only it fetches GET data.

$this->input->get('some_data', TRUE);

To return an array of all GET items call without any parameters.

To return all GET items and pass them through the XSS filter set the first parameter NULL while setting the second parameter to boolean TRUE.

$this->input->get(NULL, TRUE); // returns all GET items with XSS filter
$this->input->get(NULL, FALSE); // returns all GET items without XSS filtering

To return an array of multiple GET parameters, pass all the required keys as an array.

$this->input->get(array('field1', 'field2'));

Same rule applied here, to retrive the parameters with XSS filtering enabled, set the second parameter to boolean TRUE.

$this->input->get(array('field1', 'field2'), TRUE);
doc_CodeIgniter
2016-10-15 16:31:38
Comments
Leave a Comment

Please login to continue.