$string = ""; if (isEmpty($string)) { echo "The string is empty"; }
$array = array(); if (isEmpty($array)) { echo "The array is empty"; }
$var = null; if (isEmpty($var)) { echo "The variable is empty"; }This utility method is provided by many PHP packages and libraries, such as Laravel, Symfony, and Zend Framework. However, it is not a standalone library or package.