assign("str", string)"; 2. Use "$this->display()" to call the template; 3. Use the md5 function to encrypt and output. The syntax is "{$str|md5}"."/> assign("str", string)"; 2. Use "$this->display()" to call the template; 3. Use the md5 function to encrypt and output. The syntax is "{$str|md5}".">

Home>Article>PHP Framework> What is the thinkphp string encryption method?

What is the thinkphp string encryption method?

WBOY
WBOY Original
2022-02-15 11:53:46 3886browse

Method: 1. Use the assign() function to pass the string to the html page. The syntax is "$this->assign("str", string)"; 2. Use "$this-> ;display()" to call the template; 3. Use the md5 function to encrypt and output, the syntax is "{$str|md5}".

What is the thinkphp string encryption method?

The operating environment of this article: Windows 10 system, ThinkPHP5 version, Dell G3 computer.

What is the thinkphp string encryption method

In the Thinkphp template, you can use the php encryption function to encrypt the string.

Create a Show controller to explain how to encrypt strings in Thinkphp templates.

What is the thinkphp string encryption method?

In the Show controller, create an index method to pass data to the template.

What is the thinkphp string encryption method?

In the index method, use assign to pass the string cccbbbddd to the index.html page.

What is the thinkphp string encryption method?

In the index method, the page is rendered and outputted through the display method.

What is the thinkphp string encryption method?

In the index.html page, the string is encrypted through the md5 function and output on the page.

What is the thinkphp string encryption method?

Execute the index method of the Show controller in the browser and view the results.

What is the thinkphp string encryption method?

Summary:

1. Create a Show controller, and create an index method in the Show controller.

2. In the index method, use assign to pass the string cccbbbddd to the index.html page.

3. In the index method, the page output result is rendered through the display method.

4. In the index.html page, encrypt the string through the md5 function and output it on the page.

5. Execute the index method of the Show controller in the browser and view the results.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the thinkphp string encryption method?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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