Example of how to use functions in the thinkPHP template _ php instance

Source: Internet
Author: User
This article mainly introduces how to use the functions in the thinkPHP template, and compares and analyzes the use of php functions separately with the corresponding use of php functions in the thinkPHP template in the form of examples, for more information about how to use functions in the thinkPHP template, see the examples in this article. We will share this with you for your reference. The details are as follows:

1. use methods in php

<? Php $ var_num = "13966778888"; $ str = substr_replace ($ var_num, '*****',); echo $ str; $ var_date = time (); $ str = date ("Y-m-d H: I", $ var_date); echo $ str;?>

2. use in the template

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

If the variable is the first parameter, ### is not required ###.

If it is not the first, use ### to mark the location.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.