I want this function to return false when for each statement has stopped looping. And true if it's not empty.
function check_empty($post_array){
$items_in_array = count($post_array); //array length
echo $items_in_array;
foreach($post_array as $key=>$value){
if(empty($value)){
echo $key . " field cannot be left empty" . "</br>";
}
}
return false;
}
Note: if i return false inside foreach it will stop right on first iteration i want it to complete iteration and only stop when it has iterated over all the values in that array($post_array)