1. Static as much as possible:If a method can be static, it is declared as static, and the speed can be increased by 1/4, or even increased by nearly three times during my testing.Of course, this test method needs to be executed more than 100,000
Copy codeThe Code is as follows:// Define the size of the thumbnail.$ PicSize = array ('1970 _ 100' => 1,'2017 _ 000000' => 1);$ ImagePath = "../image /";Function parseUrl ($ url ){Preg_match ("/(? P [\ w \ d] +) _ w (? P \ d +) _ h (? P \ d + )\.
The fopen () function is used to open a file in PHP.The first parameter of this function contains the name of the file to be opened, and the second parameter specifies the mode used to open the file:Copy codeThe Code is as follows:$ File = fopen
Use of MVC in phpFirst, let me give an example:A simple article Display SystemIn simple cases, we assume that the article system is read-only. That is to say, this example will not involve the publishing of the Article. Now it is started.Since it
PHP comparison operators appear too frequently, especially =If (a = B ){// Do something}But have you really mastered =? Details are important!Let's look at the following code and give the answer you think is correct.Var_dump ('123fg456 '= 123
We usually write phpinfo () When configuring the php environment. This function is used to test whether the php environment is successfully installed. However, this function also brings security risks to the system, so how can we turn off this
Similar to mysql_fetch_row (), the mysql_fetch_array () function is used to obtain the data of the current row in the result set and automatically slide down the row after the call. It is defined as follows.Copy codeThe Code is as follows:Array
The define () function defines a constant.The define () function defines a constant.Constants are much like variables, except t for the following differences:Constants [constant] and variables [variable] have many similarities, so they are easy to
PHP is fast, reliable, cross-platform application, and open source code. This makes PHP one of the most popular server-side Script languages. Based on what I learned at work, I would like to introduce my experiences in using PHP and hope to help you.
Multiple Functions use the same name, but the parameter table, that is, the number of parameters or (and) data types can be different. Although the method name is the same during the call, however, the corresponding function can be automatically
Therefore, I think all session-related tables should be specially treated in the master-slave database design. That is, all session data tables can be updated and queried. When a user accesses the site, the user is bound to the specified database.
SyntaxString can be defined in three methods''(Single quotes)" "(double quotes) Escape sequences can be interpreted \The biggest feature of double quotation marks is that the variable name will be replaced by the variable valueThe delimiters can
Regular ExpressionThere are two sets of regular expression function libraries in PHP. The two functions are similar, but the execution efficiency is slightly different:One set is provided by the PCRE (Perl Compatible Regular Expression) Library.
Copy codeThe Code is as follows:Date_default_timezone_set ('prc'); // Default Time ZoneEcho "Today:", date ("Y-m-d", time (), " ";Echo "Today:", date ("Y-m-d", strtotime ("18 June 2008"), " ";Echo "yesterday:", date ("Y-m-d", strtotime ("-1 day"), "
First1. Make sure that you have the php_mbstring.dll file in Windows/system32. If not, just export it to Windows/system32 from the extensions directory of your Php installation directory.2. Find php. ini in the windows directory to open the editor,
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