I would like to write a function to return a string with html code to customize head title, description and keywords for multiple pages. I started with my index.php file and two auxiliary, _head.php and _functions.php. What do I have to do to implement this function?
index.php:
<?php include "_functions.php; ?>
<html>
<?php echo make_head("My title", "My description", "My keywords); ?>
<body>
...
</body>
</html>
_functions.php:
function make_head(title, description, keywords) {
return file_get_contents("_head.php");
}
_head.php
<head>
...
<meta name="description" content="$description">
<meta name="keywords" content="$keywords">
<title>$title</title>
...
</head>