Application of the PHP user status management function. User status management (sessionsupport) is a new feature that has long been expected in PHP4.0. In the PHP3.0 era, session support is a new feature in PHP 4.0 that requires programmers to use a
Phpinclude and include_once, require and require_once
* Include () and include_once ()* Require () and require_once ()1. the include () function reads the specified file and runs the program.Example: include ('/home/me/myfile ');
The program code in
Core Summary: The user used by the php-fpm sub-process cannot be the website file owner. Any violation of this principle does not comply with the minimum permission principle.
According to continuous feedback in the production environment, php
Include () and require (): The statement includes and runs the specified file.Include () generates a warning and require () causes a fatal error. In other words, if you want to stop processing the page when a file is lost, use require (). This is
PHP efficient writing, php High Efficiency1. 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
A beginner of PHP's accompanying notes, record their growth!A PHP base1.php,web Program Development language, server-side scripting language2.PHP Benefits(1) PHP Code Open Source(2) Support multiple Web servers (Apache,iis,nginx, etc.)(3) Support
1. Static Method as much as possible: if a method can be static, it should be declared as static. The speed can be improved by 14, or even improved by nearly three times during my testing. Of course, this test method needs to be executed more than 10
You can set the server-to-error alarm level in php.ini. By default, PHP will report all errors except for notifications.Error reporting levels are set by a number of predefined constants,Grammarint error_reporting ([int level]) 1 e_error report
When PHP generates a random number, if the range limit is too large, the generated random number is very large. Why? Test code: {code ...} result: {code ...} I have run this code for dozens of times. The result is the same. The random numbers
This article provides a detailed analysis of the differences between require and require_once, include, and include_once. For more information, see
This article provides a detailed analysis of the differences between require and require_once,
The use of require is as follows: require (MyRequireFile. php );. This function is usually placed at the beginning of the PHP program. Before the PHP program is executed, it will first read the file specified by require to make it a part of the PHP
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
Session support is a new feature in PHP 4.0 that has long been expected. In the PHP 3.0 era, programmers must use the function library written by others to implement the State management function, or simply give up this function. The lack of status
error level for PHP
First you need to know what PHP errors are. Up to php5.5, a total of 16 error levels
Note: When trying the following code, make sure to open error_log:
Error_reporting (E_all); Ini_set (' display_errors ', ' on ');
E_error
This
Problem Introduction
First look at the assignment and reference problems in PHP
What is your answer to the question in the middle? Before today, my answer is to allocate memory space for B. Because that's what I understand:& when assigning a value,
When uploading a file, you need to specify the path of the upload file, however, if the face of a large number of users upload different files, it will inevitably have the same name, which will cause file replacement, resulting in the loss of files,
Description of the difference between require and require_once in php. Include () and require (): The statement includes and runs the specified file. Include () generates a warning and require () causes a fatal error. In other words, if you want to
Php is optimized in this way. PHP-some performance optimization methods 0. use single quotes instead of double quotation marks to include strings, which is faster. Because PHP will search for variables in strings enclosed by double quotes, single
Since PHP5, introduced the AutoLoad this interceptor method, can automatically carry on the class file to contain the reference, below to see the concrete use method.
In the process of PHP development, if you want to introduce a class from the
Php variable problem $ baaa; $ a & amp; $ B; $ bddd; unset ($ B); echo $ a; output ddd at this time; question: $ a & amp; $ B; this statement assigns the memory address of variable B to $ a. changing the value of value a of variable B also changes
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.