$var = null; if (CRM_Utils_System::isNull($var)) { echo "Variable is null"; } else { echo "Variable is not null"; }
$var = "Hello World!"; if (CRM_Utils_System::isNull($var)) { echo "Variable is null"; } else { echo "Variable is not null"; }Output: "Variable is not null" This function is a part of the CRM_Utils_System library, which is a package that provides various utility functions for use with the CiviCRM application.