Im using this script to change title and desc and tags and what it does it changes only title.
<?
function change_meta_tags($title,$description,$keywords){
// This function made by Jamil Hammash
$output = ob_get_contents();
if ( ob_get_length() > 0) { ob_end_clean(); }
$patterns = array("/<title>(.*?)<\/title>/","<meta name='description' content='(.*)'>","<meta name='keywords' content='(.*)'>");
$replacements = array("<title>$title</title>","meta name='description' content='$description'","meta name='keywords' content='$keywords'");
$output = preg_replace($patterns, $replacements,$output);
echo $output;
}
?>
you can see in this site how does it look https://tibiaservers.net/blog/post/how-to-make-ots-website
there are outputted:
echo $_LANG['config']['title'];
echo $_LANG['config']['desc'];
echo $_LANG['config']['postTags'];
I used
change_meta_tags($_LANG['config']['title'], $_LANG['config']['desc'],$_LANG['config']['postTags']);
In page source you can see title has changed but no description and keywords