php - if-check for all array values -
i have form in html , code in php. form contains lot of different <input> things. , want text output in browser if all fields not empty.
for example, 2 fields called name , age, following:
if($_post['name'] , $_post['age']) { ... } but here have more 2 fields. should do?
you try this
$allset = true; foreach($_post $key => $value){ if(empty($value)){ $allset = false; break; } }
Comments
Post a Comment