What is the standard method in PHP to retrieve data from an HTML form submitted by a user?

To retrieve data from an HTML form submitted by a user in PHP, you can use the $_POST or $_GET superglobal arrays depending on the form submission method (POST or GET). These arrays contain key-value pairs of form data where the key corresponds to the name attribute of the form input fields. You can access the form data by using the $_POST['input_name'] or $_GET['input_name'] syntax.

// Assuming the form method is POST
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $username = $_POST['username'];
    $email = $_POST['email'];
    
    // Use the retrieved data as needed
    echo "Username: " . $username . "<br>";
    echo "Email: " . $email;
}