Can php be modified to create a custom way to call a php function without opening and closing php tags? For example, given an example function like this that is included in my static pages:
<?php
function title(){
$files = array(
"service.php"=>"This is a Service Page Title",
"index.php"=>"This is a Home Page Title",
"contact.php"=>"This is a Contact Page Title"
);
foreach($files as $file => $title) {
$thisFile = basename($_SERVER['PHP_SELF']);
if($file == $thisFile){
echo $title;
break;
}
}
};
?>
Is there anyway to modify php at its core, so that it could be called, for example, like this:
<title>{{Title}}</title>
Instead of this:
<title><?php title(); ?></title>
Seems everyone under the sun is writing template engines that use this nice friendly syntax with the double curly braces to surround variables. I was just trying to think of a way to avoid installing something else and just do this with native php.