Welcome Guest, Not a member yet? Register   Sign In
How to understand if parameter is empty
#1

Hi. For example i have a delete method in users controller. I want to if there is no parameter i should redirect the user.

For example these codes are not working. I am waiting advices.

PHP Code:
public function delete($incomingId)
 
   {
 
       if (empty($incomingId)) {
 
           redirect(base_url());
 
       }
 
   
or

PHP Code:
public function delete($incomingId)
 
   {
 
       if (!$incomingId) {
 
           redirect(base_url());
 
       }
 
   
PHP Code:
public function delete($incomingId)
 
   {
 
       if (!isset($incomingId)) {
 
           redirect(base_url());
 
       }
 
   
Reply


Messages In This Thread
How to understand if parameter is empty - by bomi - 06-16-2019, 09:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB