The difference between 1.echo and printThe functions of Echo and print in PHP are basically the same (output), but there are subtle differences between the two. There is no return value after the echo output, but print has a return value and returns
There are three types of access modifiers in PHP, namely:Public (common, default)
Protected (Protected)
Private (privately)
Public (common, default) in PHP5 if the class does not have an access modifier for the specified member, the default is the
Have analyzed the source of strtr before, now compare Strtr, str_replace and preg_replace efficiency:
Copy CodeThe code is as follows:
$str =
' 111111110000000000000000000000000000000111000001000100010000010010000010010000010100000010
';
$str = Str_
I use Eclipse for PHP project development, according to the company development norms, to use 4 spaces to replace the TAB key, search on the Internet a lot, are not too comprehensive, now the detailed configuration is displayed as follows:
first go
Recently, the need to meet the test requirements, the Big data concurrency test, reported "HTTP error 500.0-internal Server error E:\PHP\php-cgi.exe-FastCGI process exceeded the configured activity timeout period"
Workaround:
iis7->fastcgi
The code is as follows:
Copy CodeThe code is as follows:
$a;
$b = false;
$c = ";
$d = 0;
$e = null;
$f = Array ();
the first is the empty var_dump output:Boolean true
Boolean true
Boolean true
Boolean true
Boolean true
Boolean true
Then the
PHP files in garbled (such as a.php files in the browser garbled):The header ("Content-type:text/html;charset=utf-8") is the setting page.
mysql_query ("Set names Utf-8") sets the database.
Struts in Java:Chinese garbled problem generally refers to
It can be said that there is no technical content of the method:Rename the Page.class.php copy to one, such as nPage.class.php.
And will be in nPage.calss.php
$this->varpage=c (' Var_page ')? C (' Var_page '): ' P '
Switch$this->varpage=c ('
First let's look at an example
Copy CodeThe code is as follows:
Var_dump (Memory_get_usage ());
$a = "laruence";
Var_dump (Memory_get_usage ());
unset ($a);
Var_dump (Memory_get_usage ());
The output (on my PC, may vary depending on the system, PHP
I think someone who thinks the same as I do this: the uploaded files just want to use temporarily, do not need to save the original files, such as resize, and these late operations will appear in the second round from the client request to operate,
Reason:In the program I have a strict timeout limit for curl to get content, so it will cause the problem of unable to get the content.
WORKAROUND: Set default access to IPv4.The Curl settings for PHP are as follows:
Copy CodeThe code is as
Recently with Zend studio7.2 encountered a problem, is to open the content of a lot of PHP page (>500 line), the editing save speed is very slow.
Depending on what Google has on the web, change the content Assist (7.1 and previous version to Code
The following example looks at the specific differences between the three functions, where var_dump and var_export are less useful, but they are very similar to each other. So you can look at:
Copy CodeThe code is as follows:
$a = Array (1,1,32,322
The time type of MySQL has the corresponding time type in JavaDate Java.sql.Date
Datetime Java.sql.Timestamp
Timestamp Java.sql.Timestamp
Time Java.sql.Time
Year Java.sql.Date
to analyze ItRefer to MySQL reference manual
Date:A date. The
I. Introduction to OpenSSLData encryption is an important part of information transmission. Any information transmitted in clear text is indeed a very unsafe practice. So,
Data needs to be encrypted. Convert plaintext data to ciphertext data before
Brief introductionEven if you develop a new large PHP program, you will inevitably need to use global data, because some of the data needs to be used in different parts of your code. Some common global data are: Program setting class, database
Need to read a few lines of a file, but the file is relatively large, so the next PHP read a few lines of the content of the method, wrote a method, the code is as follows (annotated):
If the cache file can be saved on a single line, and the
There are a lot of people learning PHP, many of the PHP training of friends in the study will always ask such a question: PHP connection function Implode What is it?
PHP can divide the string into an array, and also can be connected to the string,
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