【发布时间】:2014-02-08 15:37:14
【问题描述】:
我正在尝试用 ob_get_contents() 替换链接,但我正在使用另一个函数来替换标题等标签... 使用此代码,我得到双页眉、索引和页脚。
功能
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();
}
【问题讨论】:
标签: php output str-replace ob-get-contents