Find out HTTP method in PHP [duplicate]

$_SERVER['REQUEST_METHOD']

See the docs. It will contain the request method upper-cased (i.e. ‘GET’, ‘HEAD’, ‘POST’, ‘PUT’).

Leave a Comment