How can you specify a target frame when redirecting with the header() function in PHP?

When redirecting with the header() function in PHP, you can specify a target frame by using the "Location" header with the URL of the page you want to redirect to along with the target frame specified using the "target" attribute. You can set the target frame by appending "#_targetFrameName" to the URL.

header('Location: http://example.com/page-to-redirect-to.php#_targetFrameName');
exit();