How to use php to set title

115

How to use php to set title -

//1. Simply add $title variable before require function
<?php

$title = "Your title goes here";
require("header.php");

?>
  
  
//2. Add following code into header.php

<title><?php echo $title; ?></title>

Comments

Submit
0 Comments