I have a form that post this values:
actusr 16
crediti[0] CD000001125 crediti[1] CD000001126 crediti[2] CD000001127
garanzia[0] 11556493.48 garanzia[1] garanzia[2]
soff_for SF000000179
soff_who SF000000002
tipo_gar[0] 1 tipo_gar[1] tipo_gar[2]
I'd like to count how many items in tipo_gar array have a non empty value.
I can do it via foreach:
$count = 0;
foreach($_POST['tipo_gar'] as $to_count){
if($to_count != ''){
$count=$count+1;
}
}
but I guess there is a built-in php functionality I am not aware of that will do the trick saving me some lines of code.