This doesn't seem to work correctly for me, it always returns an empty string. I could not find the error that I made.
function title($page){
$i=0;
$title="";
foreach ($page as $c){
if ($i===0){
ucfirst($c);
}
if ($c=="_"){
$c=" ";
}
$i++;
array_push($title,$c);
}
return $title;
}