php title
function set_page_title(){
global $page_title;
/*
you should make the variable global so the function can access it and set it to the page title
otherwise you will get an error.
*/
if(isset($page_title)){ /*Check if my code has that variable*/
echo $page_title;
}
else{
echo "Page Title";
}
}
/*
HTML Layout
<!DOCTYPE html>
<head>
<title><?php set_page_title() ?></title>
</head>
...
*/