if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Boom baby we a POST method
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// We are a GET method
}
php detect request type
// Check request method in php using super global variable $_SERVER
if(isset($_SERVER['REQUEST_METHOD'])){
// Now display request method
echo $_SERVER['REQUEST_METHOD'];
}