Is empty check in php?



Is empty check in php?..

Answer / Gopal Ji

Yes, PHP provides several ways to check if a variable is empty. You can use the `empty()` function or the `isset()` function combined with the `!== null` comparison. For example: `if(empty($variable)) {...}` or `if(!isset($variable) || $variable === null) {...}`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How do I make a reset button in html?

1 Answers  


What are the __construct() and __destruct() methods in a php class?

1 Answers  


What is isset in php form?

1 Answers  


When are you supposed to use endif to end the conditional statement?

1 Answers  


How to execute an sql query? How to fetch its result?

1 Answers  


1. Write a function to swap two values ? $a = 10; $b = 20; echo $a, $b; swap(); // If u want u can pass parameters echo $a, $b; // It should print 20 , 10

14 Answers   Aquasol, Infosys, TCS, Torque Infotech,


What is cURL in PHP?

1 Answers  


What is different between software and app

1 Answers  


What exactly is PHP?

1 Answers  


Tell me how can we display information of a variable and readable by human with php?

1 Answers  


What is the use of mysql_fetch_assoc in php?

1 Answers  


Does exist in php?

1 Answers  


Categories