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;
}
Try
function title($page)
{
return ucfirst(str_replace('_', ' ', $page));
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.