Using isset() Function
The isset() function is an inbuilt function in PHP which checks whether a variable is set and is not NULL. This function also checks if a declared variable, array or array key has null value, if it does, isset() returns false, it returns true in all other possible cases. This problem can be solved with the help of isset() function.
bool isset( $var, mixed )
Description: This function accepts more than one parameters. The first parameter of this function is $var. This parameter is used to store the value of variable.
The empty() function is an inbuilt function in PHP which is used to check whether a variable is empty or not.
bool empty( $var )
Description: This function determine whether a variable is empty or not.
- CSS | :checked Selector
- HTML | checked Attribute
- HTML | DOM Input Checkbox Property
- CSS | :read-only Selector
- Dirty read in SQL
- CSS | :read-write Selector
- How to read any request header in PHP
- Getting started with React Native? Read this first !
- How to read Competitive Programming Questions?
- Ways to read input from console in Java
- Node.js REPL (READ, EVAL, PRINT, LOOP)
- hwclock command in Linux with examples
- BootStrap | Text Utilities (Alignment, Wrapping, Weight etc.)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.