Home  »  CodeSnippets   »   Check if is GET Request in PHP

Check if is GET Request in PHP

Posted: February 7, 2022 | by Site Host

Use the $_SERVER built-in global variable:

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.

Share it!

See also  How to get Current Date and Time in Python