PHP is_null() Function

PHP debug_backtrace() Function
PHP is_long() Function

In this article, you will learn how to check if a variable contains NULL or not in PHP. The is_null() function in PHP checks whether a variable is NULL or not.

This function returns true (1) if the variable is NULL, otherwise it returns false/nothing.

what is the syntax of the IS_NULL() function in php?

is_null(variable);
ParameterDescription
variableRequired. Specifies the variable to check
PHP is_null() method

examples of the IS_NULL() function

Example 1. In this example, we check whether a variable is NULL or not.

<?php
$a = 0;
echo "a is " . is_null($a) . "<br>";

$b = null;
echo "b is " . is_null($b) . "<br>";

$c = "null";
echo "c is " . is_null($c) . "<br>";

$d = NULL;
echo "d is " . is_null($d) . "<br>";
?>
PHP debug_backtrace() Function
PHP is_long() Function
en English
X
Scroll to Top