I have a simple question related to input post method. There are two input fields as follows :
$this->input->post('billed_date')
$this->input->post('branch_id')
Then I want to combine this two input post methods using logical "OR" argument. I used the following code :
if($this->input->post('billed_date', 'branch_id'))
{
.....some codes...
}
But didn’t get the desired result. How can I combine these two post methods using "OR". Can anyone help ?
2
Answers
The
post()
method of CodeIgniter’s input library doesn’t support passing multiple keys in that way. You need to do it separately like this:If you need it as logical OR (e.g only one variable needs to be present) you do it like this:
for better understand using isset function within if condition
or you may use OR replace on || then code like below