"checking if all the array items are empty php" Code Answer


You can just use the built in array_filter

If no callback is supplied, all entries of input equal to FALSE (see converting to boolean) will be removed.

So can do this in one simple line.

if(!array_filter($array)) {
    echo '<li>Please enter a value into at least one of the fields regarding the request you are searching for.</li>';
By asro2004-8c32e7c7c150 on October 18 2022

Answers related to “checking if all the array items are empty php”

Only authorized users can answer the search term. Please sign in first, or register a free account.