There are many functions that intercept strings in php, and php functions can also be used directly in thinkphp. This article will give you a brief introduction to the specific usage of intercept strings in the thinkPHP template, hope to help you.
Many times when we use smarty, we do not want to cache the whole page, such as the real-time update information such as weather and stock. Therefore, we can leave it Uncached. The common implementation methods are as follows:
1. insert method:
The
PHP extension reflection class, which is used to analyze php programs, export or extract detailed information about classes, methods, attributes, parameters, and so on, including comments.Let's look at this question. The member variables of the php
The following functions can be used to filter user input to ensure that the input is XSS safe. For more information about how to filter data, see the function and add comments.Copy codeThe Code is as follows:Function RemoveXSS ($ val ){// Remove all
Let's look at the code. It's easy to understand.Copy codeThe Code is as follows:// Use echo remote_filesize ($ url, $ user = '', $ pw = '');$ Url = "http://www.aa.com/librarys/images/random/rand_11.jpg"; // here you want to change to your image
Statistical graphs are the data graphs we often see. If three arrays are displayed in graphs or the buildings are directed at graphs, we will use graphs, next I will introduce a php LIbchart Graph Generation class. For more information, see.The
In web development, Object serialization and deserialization are often used. The mainstream formats include json format and xml format serialization and deserialization. Today I want to write a small jsop demo, the result shows that php
The header () function sends the original HTTP header to the client.Copy codeThe Code is as follows:// 200 normal statusHeader ('HTTP/1.1 200 OK ');// 301 permanent redirection. Remember to add the targeted address Location: $ url later.Header
There is no difference in itself, habits, but sometimes it involves the operator priority problem, the results will be different, record.For example:Copy codeThe Code is as follows:$ P = 6 or 0;Var_dump ($ p); // int (6)$ P = 6 | 0;Var_dump ($ p); //
$ _ SERVER ['php _ SELF '] # File Name of the script being executed, which is related to document root.
$ _ SERVER ['argv'] # parameters passed to the script.
$ _ SERVER ['argc '] # contains the number of command line parameters passed to the
Sometimes, when we run the php program again
Allowed memory size of 8388608 bytes exhausted (tried to allocate 1298358 bytes)
Cause of the error: make sure it is not the cause of the program (such as an endless loop ), because the maximum memory
Destructor:It is executed when an object becomes garbage or when the object is explicitly destroyed.
GC (Garbage Collector)
In PHP, when no variable points to this object, this object becomes garbage. PHP will destroy it in the memory.
This is the
The following code first checks the source of the previous page for the submission of forged data from a URL:
This method can only prevent the URL entered manually on the browser bar.In fact, as long as a link to the URL is constructed on the
18. fleet activities (FlyingFleetHandler. php)
In the previous article, we have initially studied the source code of the fleet activity and mentioned the triggering of the fleet activity. Now I will further analyze the Xnova fleet activities, which
ThinkPHP session cross-domain issues many developers have encountered!In fact, whether it is ThinkPHP or php, you need to set session. cookie_domain when solving session cross-domain problems.In ThinkPHP, You need to modify the configuration file
The pack and unpack functions can be used to read and write binary files in php.To solve the problem of a binary file today, we need to take a look at the usage of pack. The usage of unpack is similar to this.
Simply put, the pack function provides
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