How can a PHP beginner create a HTML redirection?

To create a HTML redirection using PHP, beginners can use the header() function to send a raw HTTP header that performs the redirection. This function must be called before any actual output is sent to the browser to avoid errors. By setting the "Location" header to the desired URL, the browser will automatically redirect to that page.

<?php
// Redirect to a specific page
header("Location: https://www.example.com");
exit;
?>