精華 帝國(guó)PHP系統(tǒng)CMS內(nèi)容頁(yè)顯示副標(biāo)題,怎樣判斷?
<p>方法1:當(dāng)有副標(biāo)題的時(shí)候優(yōu)先顯示副標(biāo)題:</p>
代碼:<?php echo $navinfor['ftitle']?$navinfor['ftitle']:$navinfor['title'] ?>
方法2:當(dāng)副標(biāo)題與標(biāo)題哪個(gè)長(zhǎng)的時(shí)候顯示長(zhǎng)的:
代碼:
<?php
if(strlen($navinfor['title'])>=strlen($navinfor['ftitle']))
{
?>
[!--title--]
<?php
}
else
{
?>
[!--ftitle--]
<?php
}
?>
加代碼加到模板開(kāi)頭的<title></title>中間。