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

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -