How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP?
It is valuable to additionally note, that PHP will populate all the $_GET parameters even when you send a proper request of other type.
Methods in above replies are completely correct, however if you want to additionaly check for GET parameters while handling POST, DELETE, PUT, etc. request, you need to check the size of $_GET array.