What role does the method attribute in the HTML form tag play in submitting form data to a PHP script?

The method attribute in the HTML form tag specifies the HTTP method used when submitting form data to a PHP script. The two most common methods are GET and POST. When using a form to submit data to a PHP script, it is important to specify the correct method to ensure that the data is sent securely and accurately.

<form action="process_form.php" method="post">
  <!-- form fields go here -->
  <input type="submit" value="Submit">
</form>