开发者

Problem with multiple str_replace

I have 2 linked files and I need to replace 2 things. only the first one works the other still has the placeholder.

FILE 1

ob_start() ;

//buffers and gets title and meta
echo "<title>";
$gettitle="##pa开发者_高级运维getitle##";
echo $gettitle;
echo "</title>";

echo "<META NAME=\"Description\" CONTENT=\"";
$getmeta="##metacontent##";
echo $getmeta;
echo "\">";

FILE 2

$pagetitle = "Reviews and Tutorials" ;
  str_replace("##pagetitle##", $pagetitle, $gettitle) ;
$metacontent = "Reviews and Tutorials from Socal Mods. Discover something new!" ;
  str_replace("##metacontent##", $metacontent, $getmeta) ;
ob_clean;

So in the resulting page the title works, but it just prints ##metacontent##.

thanks in advance

Ive tried screwing around with different ob_ controls but cant get it to work.


Remove the first ob_clean. It would work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜