Home > PHP Framework > ThinkPHP > A brief analysis of the differences and usage scenarios between I() and create() methods in ThinkPHP

A brief analysis of the differences and usage scenarios between I() and create() methods in ThinkPHP

藏色散人
Release: 2021-12-30 17:40:52
forward
2448 people have browsed it

The following thinkphp framework tutorial column will give you a brief analysis of the differences and usage scenarios of the I() and create() methods in ThinkPHP. I hope it will be helpful to friends in need!

A brief analysis of the differences and usage scenarios between I() and create() methods in ThinkPHP

What is the difference between the I() method receiving data and the create() method receiving data in ThinkPHP?

Difference:

  • The I() method will automatically filter html entities;

  • ## The #create method needs to manually call the filter method of the model after automatic creation. Create includes automatic creation of data objects, automatic verification, automatic completion, and field mapping.

Which one is generally used more frequently?

  • When the number of accepted fields is small and those automatic functions are not needed, use the

    I() function;

  • Accepts a large number of fields, uses the

    create() method, and can complete many functions when creating data, which is convenient and fast.

Recommended study: "

The latest 10 thinkphp video tutorials"

The above is the detailed content of A brief analysis of the differences and usage scenarios between I() and create() methods in ThinkPHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Issues
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template