Is there a way of checking all of the items in $_POST in one line, instead of each item individually? It seems stupid to repeat one regular expression numerous times if you want it to apply to all items. e.g.
if (preg_match('/foo/', $_POST['name']))
//repeat...
would be much better as
if (preg_match('/foo/', $_POST['everything']))
I guess that it might involve “foreach”, but I don’t understand how that works or how to use it. I tried Googling for this but not knowing what to search for made that very difficult…