QUOTE:
判断 Date("G") ...这个功能大家是怎么实现的呢 ...?
根据不同的结果显示 早上好 上午好 下午好 晚上好 ...
整个网页只需要这三个字儿 ... 其他都不用管 ...
是这样 ..?
QUOTE:
php side或者是这样 ...?
$array = ( '早上好', '上午好', '下午好', '晚上好' );
if ( date('G') < 9 ) $tmp = 1;
elseif // something like this
$this->template->assign( 'greeting', $array[ $tmp ] );
html side
{greeting}
QUOTE:
php side又或者是这样 ..?
if ( date('G') < 9 ) $tmp = 1;
elseif // something like this
$this->template->choose_block( 'greeting', $array[ $tmp ] );
html side
{greeting:早上好,上午好,下午好,晚上好}
QUOTE:
php side现在您在实现这个功能的时候用的是什么方式呢 ..?
$tmp = date('G');
html side
{if $tmp lt 9 }
早上好
{elseif .... }
.............
{/if}
或者您有什么更好的方式 ...?
欢迎发表意见 ...

我也来说两句 查看全部评论 相关评论