I want to change the title of my PHP pages dynamically but since the headers and footer sections are include files so I cannot use <title><?php echo $title;?></title>
kind of solution.
I am wondering if there is any solution such as the one in Asp.NET Page.Title = "Some Title";
maybe like $page->set_title('Programmers Palace');
Many thanks...
Since the headers and footer sections are include files so I cannot use
<title><?php echo $title;?></title>
kind of solution.
You can. Just because the files are included doesn't mean you can't echo things there.
If you had a Page
object...
<?php
$page = new Page('Programmers\' Palace');
include 'includes/header.php';
<head>
<title><?php echo $page->getTitle(); ?></title>
</head>