PHP | is_null() Function (original) (raw)
Last Updated : 11 Jul, 2025
The is_null() function is an inbuilt function in PHP which is used to find whether a variable is NULL or not.
Syntax:
boolean is_null ( $var )
Parameters: This function accepts a single parameter as shown in above syntax and described below.
- $var: Variable to check if it is NULL or not.
Return value: It returns a boolean value. That is, it returns TRUE when $var will be NULL, otherwise it returns FALSE.
Below programs illustrate the is_null() function in PHP:
Program 1:
PHP `
`
Output:
True False False False
Program 2:
PHP `
`
Output:
True True True True True True True True False False
Reference: https://www.php.net/manual/en/function.is-null.php