My index.php looks like this:
<!DOCTYPE html>
<html>
<head>
<title><?php echo $title?></title>
</head>
<body>
<p>Hi, this is my homepage. I'll include some text below.</p>
<?php
include "myfile.php";
?>
</body>
</html>
"myfile.php" e.g. includes the following:
<?php
$title = "Hi, I'm the title tag…";
?>
<p>Here's some content on the site I included!</p>
The <p> gots outputted but the <title> tag stays blank.
How can I reach to get $title from the included site and also show the included content inside the <body> tag?
includeis used to include files. Make your question a bit more clear.$titlevariable.<body>tag, and not beforetitletag. How to do that?