Posted: February 7, 2022 | by Michael Bright
Use the $_SERVER built-in global variable:
$_SERVER
if ($_SERVER['REQUEST_METHOD'] === 'POST') { // your code here }
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.
Check if is POST Request in PHP
How to set the JSON Header in PHP