Por ejemplo con algo así...
Código
function checkEmpty($var) { return False; // No esta vacia } else { return True; // Esta Vacia } }
Quedaría algo así...
Código
foreach ($arr as $valor) { echo "<pre>"; /* * TRUE FALSE => "0" * TRUE TRUE => "" * FALSE FALSE => "1" * FALSE FALSE => "False" * FALSE FALSE => "hola" * TRUE FALSE => 0 * TRUE TRUE => False * FALSE FALSE => True */ echo "</pre>";
Si no entendí mal con esto en teoría no tendrías ese problema. Saludos.
Pd: No me fijé que drvy | BSM puso algo similar aunque combinado con trim para eliminar los espacios.