I still don't understand what you try to achieve. But let's say you have
<?php
//header.php
echo "This is the first header line<br>";
echo "This is the second header line<br>";
echo "This is the third header line<br>";
?>
Thera are three possibilities what you can do:
1. echo string only
<?php
$output = htmlspecialchars("<?php include('header.php');?>");
echo $output;
?>
This will show that $output is
<?php include('header.php');?>
2. echo the content of the file
<?php
$output = nl2br(htmlspecialchars(file_get_contents('header.php')));
echo $output;
?>
This will show that $output is
<?php
//header.php
echo "This is the first header line<br>";
echo "This is the second header line<br>";
echo "This is the third header line<br>";
?>
3. echo the result of executing header.php
<?php
ob_start();
include('header.php');
$output = ob_get_contents();
ob_end_clean();
echo $output;
?>
This is the first header line<br>
This is the second header line<br>
This is the third header line<br>
There isn't much more you can do with that file and the varible 😉