DEV Community

loading...
Cover image for IntVal() to see if an array is empty

IntVal() to see if an array is empty

charlygarcia120 profile image Carlos Alberto ・1 min read

intval one of the most undervaluated php funtions

echo intval(array()); // 0
echo intval(array('foo', 'bar')); // 1

Can be used to know if a array is empty, important operation for validations.

Discussion (0)

pic
Editor guide