Since PHP 8.0, passing null to strlen() is deprecated. To check for a blank string (not including '0'):
<?php
// PHP < 8.0
if (!strlen($text)) {
echo 'Blank';
}
// PHP >= 8.0
if ($text === null || $text === '')) {
echo 'empty';
}
Since PHP 8.0, passing null to strlen() is deprecated. To check for a blank string (not including '0'):
<?php
// PHP < 8.0
if (!strlen($text)) {
echo 'Blank';
}
// PHP >= 8.0
if ($text === null || $text === '')) {
echo 'empty';
}