-----------------------------------CONDITION-------------------------------
Bila hanya ingin menampilkan dan menghitung array yang memiliki value.
-------------------------------------SCRIPT------------------------------------
$arr1 = array("a1" => "aa", "b1" =>"", "c1" => "cc");$count = 0;
foreach ($arr1 as $key => $val) {
if (empty($val)){
continue;
}else{
echo $val;
echo '<br/>';
$count += 1;
}
}
echo 'Jumlah '.$count;
-------------------------------------OUTPUT------------------------------------
aacc
Jumlah 2