1if ($_SERVER['REQUEST_METHOD'] === 'POST') {
2 // Boom baby we a POST method
3}
4if ($_SERVER['REQUEST_METHOD'] === 'GET') {
5 // We are a GET method
6}
1Better use $_SERVER['REQUEST_METHOD']:
2
3if ($_SERVER['REQUEST_METHOD'] === 'POST') {
4 // …
5}