PHP empty() Function

PHP empty() Function


The empty() function is an inbuilt function in PHP which is used to check whether a variable is empty or not.

Syntax:

bool empty ( $var )

Parameter: This function accepts a single parameter as shown in above syntax and described below.

  • $var: Variable to check whether it is empty or not.