What is the difference between using an iFrame and include in PHP?

Using an iFrame involves embedding an external webpage within your own webpage, while using include in PHP involves including the contents of a separate PHP file within your current PHP file. iFrames are typically used for displaying content from an external source, while include is used for modularizing and reusing code within a PHP application.

// Using include in PHP
<?php
include 'header.php';
echo "This is the main content of the page.";
include 'footer.php';
?>