Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel check if array is empty


//for get() array methods
if($data_array->isEmpty())
{dd('EMPTY');}
else
{dd('NOT EMPTY');}

//for other array
if (count($data_array) > 0) 
{dd('EMPTY');}
else
{dd('NOT EMPTY');}
 
PREVIOUS NEXT
Tagged: #laravel #check #array #empty
ADD COMMENT
Topic
Name
2+5 =