I've been reading some online tutorials on how to do this, the most common one is using a switch case.
I guess having all the titles on 1 page using the include would make naming a very lot easier.
I came across a website which uses the str_replace() function to replace special characters
This works well but the only problem I have is that it only works on the index.php title.
so far, I have these codes
<HTML>
<HEAD>
<?php $page_name = basename($_SERVER['SCRIPT_FILENAME']);
$page_name = str_replace('_', ' ', $page_name);
$page_name = str_replace('.php', ' ', $page_name);
$page_name = ucfirst($page_name);
?>
<TITLE><?php echo $page_name ?></TITLE>
</HEAD>
<BODY>
<ul>
<li><a href="index.php?page=poppy_love">Poppy Love</a></li>
<li><a href="index.php?page=poppy_make">Poppy Make</a></li>
<li><a href="index.php?page=poppy_rar">Poppy RAR</a></li>
</ul>
<div>
<?php loadPage($page); ?>
</div>
</BODY>
</HTML>
Is there a way to get the title to change accordingly to the page I click using the method I have used?
Thanks