【发布时间】:2019-01-25 07:48:51
【问题描述】:
这里是 jdate 库jdate
我的 format.php 文件
<?php
/**
*Format Class
*/
class Format{
public function formatDate($date){
return date('F j, Y, g:i a', strtotime($date));
}
public function textShorten($text, $limit = 400){
$text = $text. "";
$text = substr($text, 0, $limit);
$text = substr($text, 0, strrpos($text, ' '));
$text = $text. "";
return $text;
}
}
?>
和我的发布日期代码
<h6><?php echo $fm->formatDate($result['date']); ?>, by<a href="#"><?php echo $result['author']; ?></a></h6>
如何使用 jdate 而不是公历时间。
【问题讨论】:
-
Small Point
$text = $text. "";什么都不做,只是使用 cpu 周期 -
第二个小点 没有明智的 SO 用户会下载未知的 zip 文件来回答问题。风险太高了。请以文本形式发布代码
标签: php jalali-calendar