What is the recommended solution for ensuring a page loads outside of a frame when using PHP?

When a page is loaded within a frame, it can cause issues with the layout and functionality of the website. To ensure a page loads outside of a frame, you can use the PHP header function to set the X-Frame-Options header to deny or sameorigin. This will prevent the page from being displayed within a frame.

<?php
header("X-Frame-Options: DENY");
?>