What is the best practice for determining whether a PHP page was called using a POST or GET method?

To determine whether a PHP page was called using a POST or GET method, you can check the `$_SERVER['REQUEST_METHOD']` variable. This variable contains the request method used to access the page. You can then use an if statement to check if it equals 'POST' or 'GET' to determine the method used.

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // Page was called using POST method
    echo "Page was called using POST method";
} elseif ($_SERVER['REQUEST_METHOD'] == 'GET') {
    // Page was called using GET method
    echo "Page was called using GET method";
} else {
    // Handle other request methods
    echo "Unsupported request method";
}