tags:

views:

51

answers:

3

I want to see if there are any POST vars set. Is there anyway i can do this?

+6  A: 
if (!empty($_POST)) {
    // handle post data
}
cballou
+1 for simpler notation
Tatu Ulmanen
+3  A: 
if(count($_POST) > 0) {
    // Post vars are set
Tatu Ulmanen
A: 

Simple, $_POST is an array containing all POST vars, just count how any items are in the array and you know if there are any set.

echo count($_POST);
Jimmy Shelter