UnkwnTech UnkwnTech - 7 months ago 10
PHP Question

Detecting request type in PHP (GET, POST, PUT or DELETE)

How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP?

Answer

By using

$_SERVER['REQUEST_METHOD']

For more details please see the documentation for the $_SERVER variable.