我正在尝试用ob_get_contents()替换链接,但我正在使用另一个函数替换标题标签,如title等。。。
使用此代码,我得到了双页眉、索引和页脚。
作用
function self_urls_convert($html) {
$html = str_replace('index.php','index',$html);
$html = str_replace('about_us.php','about_us',$html);
return $html;
}
页脚
$output = ob_get_contents();
if (ob_get_length() !== FALSE){
ob_end_clean();
}
echo self_urls_convert($output);
echo $tags->handle_output($output);
if (ob_get_length() !== FALSE){
ob_end_flush();
}