在 CodeIgniter 中三天后隐藏时间跨度函数
Hide timespan function after three days in CodeIgniter
我创建了一个列表服务,显示 post 发布的时间跨度。但是,我想在 post 超过 3 天后隐藏此功能。
这是我的代码
<div class="listing-time"><?php echo timespan($data->time); ?> since</div>
有什么想法吗?
<?php if ( time() - $data->time < 259200 ):?>
<div class="listing-time"><?php echo timespan($data->time); ?> since</div>
<?php endif;?>
我创建了一个列表服务,显示 post 发布的时间跨度。但是,我想在 post 超过 3 天后隐藏此功能。
这是我的代码
<div class="listing-time"><?php echo timespan($data->time); ?> since</div>
有什么想法吗?
<?php if ( time() - $data->time < 259200 ):?>
<div class="listing-time"><?php echo timespan($data->time); ?> since</div>
<?php endif;?>