How can relative and absolute paths affect the redirection behavior in PHP scripts?

Relative paths in PHP scripts can affect redirection behavior by causing the script to look for files or resources in different locations than intended. This can lead to errors or unexpected behavior. To avoid this issue, it's best to use absolute paths when specifying the location of files or resources in PHP scripts.

// Using absolute path for redirection
header("Location: http://www.example.com/page.php");
exit();