$_SERVER['REQUEST_METHOD']
See the docs. It will contain the request method upper-cased (i.e. ‘GET’, ‘HEAD’, ‘POST’, ‘PUT’).
More Related Contents:
- How do I implement basic “Long Polling”?
- How do I send a POST request with PHP?
- Can PHP cURL retrieve response headers AND body in a single request?
- Download File to server from URL
- continue processing php after sending http response
- How do I make an asynchronous GET request in PHP?
- Setting Curl’s Timeout in PHP
- Nginx location configuration (subfolders)
- What is the canonical way to determine commandline vs. http execution of a PHP script?
- Manually parse raw multipart/form-data data with PHP
- Super fast getimagesize in php
- Utility of HTTP header “Content-Type: application/force-download” for mobile?
- HTTP requests with file_get_contents, getting the response code
- Doing HTTP requests FROM Laravel to an external API
- Correct way to set Bearer token with cURL
- setcookie, Cannot modify header information – headers already sent [duplicate]
- PATCH and PUT Request Does not Working with form-data
- Using the PHP HTTP_ACCEPT_LANGUAGE server variable
- How to get final URL after following HTTP redirections in pure PHP?
- http_build_query with same name parameters
- Who Add “_” Single Underscore Query Parameter?
- How to make HTTP requests in PHP and not wait on the response
- Load Blade assets with https in Laravel
- Get “Content-Type” header of request in PHP
- Push notifications from server to user with PHP/JavaScript
- Simple comet example using php and jquery
- Detecting whether a user is behind a proxy
- How can I get the destination URL using cURL?
- Parsing HTTP_RANGE header in PHP
- Allowing users to Refresh browser without the “Confirm Form Resubmission” pop-up