What function in PHP can be used to redirect to another page?
In PHP, the function `header()` can be used to redirect to another page. This function sends a raw HTTP header to the client, which can be used to redirect the browser to a different location. To redirect to a different page, you need to set the `Location` header with the URL of the page you want to redirect to.
<?php
// Redirect to another page
header("Location: https://www.example.com/newpage.php");
exit;
?>
Related Questions
- What are the potential legal issues with using a script to extract .flv files from YouTube for a custom video player?
- How can the mysql_affected_rows function be used to determine if a database update or insert operation was successful in PHP?
- Are there any potential pitfalls or limitations when using disk_free_space in PHP?