Self-reducing operation in PHP
Question: If $i=2, evaluate the value of the expression ($i + +) * ($i + +) * ($i + +) and the value of the $i
Answer: ($i + +) * ($i + +) * ($i + +) The result is 5, $i
Analysis: First look at the calculation order,
A comparison of Xajax and other Ajax frameworks
Xajax function is very simple, but very flexible! ~ It's not like some other big frame, the function is really powerful, but the execution speed is not flattering. Although many functions, but not
Use PHP to filter code in HTML that might be exploited to introduce externally dangerous content. There are times when you need to have users submit HTML content to enrich the information that users publish, and of course, some of the code that
When you are programming with PHP, I have a habit of not liking to use ready-made library files, such as Phplib or other similar libraries, in this system, I also intend to write a library file, it needs to process authentication, confirm email,
Array_merge ();
Merges two arrays, if the key name of the array is a character, and the key names of the two arrays are the same characters,
Such as
$array 3=array ("Gender" => "male", "name" => "not Woman");$array 4=array ("Gender" => "Do not
Using PHP-style $globals in JavaScriptJavaScript has an implied global variable. When you do not use var to define a = 1, and you define a=1 directly, this variable a becomes a global variable. Some think this is a mistake and should avoid global
Under the KLOXO-MR of the PHP-FPM configuration file is under/etc/php-fpm.d/, here are two files, respectively, admin.conf default.conf modify first please back up these two files.
The code is as follows
Copy Code
Some regular expressions commonly used in the work are sorted out, and regular validation expressions are commonly used:
Number-related regular expressions
Number: ^[0-9]*$N-bit fixed-length number: ^\d{n}$Number between m-n bits: ^\d{m,n}$Numbers
Take a look at the regular expressions in depth today and summarize the functions that PHP's regular expressions use
Preg_match ();Preg_match_all ();Preg_replace ();Preg_filter ();Preg_grep ();Preg_split ();Preg_quote ();
There are basically so
All the JS files introduced in a Web page are matched and implemented in PHP using regular expressions, as follows:
Header ("Content-type:text/html;charset=utf-8");Match the JS file introduced in a Web page$pageContent = file_get_contents (' http://
When it comes to security verification, there are 2 judgments. One is to determine the number of specified numbers that need to be entered. The first of these is a number of digits.
Whether the PHP numeric length is a 11-bit array
$text = "11111111
Preg_replace Character Substitution Example
Here are three common methods.
code is as follows
copy code
Method One: $str = Preg_quote (' (silver) '); $txt = ' What Is mine called (silver) '; Echo
Let's take a look at the syntax of regular expressions first.
We see that there are (? =a) and (?!) in regular expressions. A) to indicate whether we need to match something.
So we have the need to not match something when we can use (?!). a).
Verify that the user name starts with a letter and that the authentication password can only be a combination of numbers and letters, three common authentication functions: Verify the format of the mailbox address, verify that the password can only
If you receive such a string in your program:
The code is as follows
Copy Code
11942268 134 Product 1 Execution The 2013-08-12 report has been 02 19434368135 Products 2 Executive 2013-05-12 report not out 0
Well,
Chinese matching in utf-8 environment
\w match only Chinese, numbers, letters, for the Chinese people, only match the English will often use, see
Matching regular expressions for Chinese characters: [\U4E00-\U9FA5]
Maybe you also need to match
For business purposes, you need to upload music. Nginx has a limit on uploading, which should be no more than 2 mb. Therefore, you need to reconfigure it.First, Configure nginx. Find the nginx. conf configuration file and modify the php module in
In the past few days, the web often encountered Nginx 502 problems. At first, as many people thought it was Nginx, I checked from the internet and found that it was originally a php-fpm problem. The web uses the nginx + php architecture. It is not
After nginx and php are configured, no logs are found for php-error. Google finally got it done, mainly to the php-fpm.conf and php. ini to make the following changes:1. Modify php-fpm.confModifying the worker process configuration for www. conf
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