If I have an if statement currently using $_POST
what would be the best way to do this using $this->input->post();?
Example:
if($_POST)
{
Do This
}
If I have an if statement currently using $_POST
what would be the best way to do this using $this->input->post();?
Example:
if($_POST)
{
Do This
}
According to the docs,
$this->input->post('value')
returns the value or false if it doesn't exist, so you should use this:
if ($this->input->post('value'))
{
// 'value' can be safely used now, because we know it's there
}