php - How to quickly check what variables exist from a bunch of vars? -


if have 10 variables set, other times unset, there quick way echo ones exist without throwing exception? these vars come user input.

i write

if ($var_1 != null) { echo $var_1; } if ($var_2 != null) { echo $var_2; } if ($var_3 != null) { echo $var_3; } if ($var_other_1 != null) { echo $var_other_1 ; } if ($var_other_2 != null) { echo $var_other_2 ; } 

etc.. there more quicker way?

compact function you


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -