How to use functions in thinkPHP templates

墨辰丷
Release: 2023-03-28 12:42:01
Original
1849 people have browsed it

This article mainly introduces the use of functions in thinkPHP templates, and compares and analyzes the use of PHP functions alone and the corresponding usage skills of PHP functions in thinkPHP templates in the form of examples. Friends in need can refer to the following

1. Method usage in php


<?php
  $var_num = "13966778888";
  $str = substr_replace($var_num,&#39;*****&#39;,3,5);
  echo $str;
  $var_date = time();
  $str  = date("Y-m-d H:i",$var_date);
  echo $str;
?>
Copy after login


##2. Usage in template


{sh:$member.tel|substr_replace="*****",3,5}
{sh:$member.addtime|date="Y-m-d H:i",###}
Copy after login


If the variable is the first parameter,

is not needed.

If it is not the first one, use

to mark the position.


The above is the entire content of this article, I hope it will be helpful to everyone's study.


Related recommendations:

phpValue passing method and ajax method to implement verification function

phpMethod to implement message board function

App messaging in Redis Detailed explanation

Detailed explanation of application messaging of Redis in php

The above is the detailed content of How to use functions in thinkPHP templates. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!