What potential pitfalls should be considered when using multiple opening and closing PHP tags in a script for URL redirection?

Using multiple opening and closing PHP tags in a script for URL redirection can lead to unexpected output or errors due to whitespace or headers being sent before the redirection. To avoid this issue, it's recommended to use a single set of PHP tags for the entire script to ensure proper execution.

<?php
// Correct way to handle URL redirection in PHP
header("Location: http://www.example.com");
exit;
?>