thinkphp模板中使用方法

1.php中的方法使用

<?php
    $var_num = "13966778888";
    $str = substr_replace($var_num,'*****',3,5);
    echo $str;

    $var_date = time();
    $str    = date("Y-m-d H:i",$var_date);
    echo $str;
?>

2.模板中的使用

{sh:$member.tel|substr_replace="*****",3,5}

{sh:$member.addtime|date="Y-m-d H:i",###}

如果变量就是第一个参数,就不需要###。
如果不是第一个,就用###来标注位置。

 

posted @ 2017-08-28 17:36  侠岚之弋痕夕  阅读(271)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!