0

我正在尝试用 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();
}
4

1 回答 1

0

你得到了两次,因为你得到echo了两次。

$output = self_urls_convert($output);
$output = $tags->handle_output($output);
echo $output;

应该管用

于 2014-02-08T15:39:24.190 回答