My basic environment is nginx1.6.2+php5.3.To do a line-by-row output, the use of Ob_flush to try the N method does not work, such as the following code:
Ob_start ();for (;;){echo " ...";Ob_flush ();Flush ();Sleep (1);}?>
Google a lot of writing is
A simple php array function, before this need has not been known to have such a function, wipe the sweat ...
PHP Array Reverse output code
The code is as follows
Copy Code
foreach (Array_reverse ($array) as $key =>
Let's take a look at a question first:
$a = 1;$b = $a + $a + +; Results: $a =2, $b =3This problem is not difficult, obviously in PHP + + priority is higher than +, so first execute $a + +, when the $a value is 2Look at one more question:
$a = 1
Abstract classes and interfaces (interface) are object-oriented concepts that are very similar in that they define the methods to be implemented, but there are different usage scenarios, and what is the difference between the abstract classes and
PHP variable naming rules
1. The variable begins with the dollar sign $. such as $name, $age.
2, dollar sign $ The first character that follows cannot be a number, only an underscore _ or a letter. Variables such as $1_1 are wrong.
3, in addition
PHP Folder action function
String basename (String path [, string suffix])
Gives a string containing a full path to a file, which returns the base file name. If the filename ends with suffix, that part will also be removed.
In Windows, the slash (
Today, my colleague said that PHP lacks a calendar module on the server, go up a check really did not, well, can only recompile the calendar this module to add in, the function of this module is Calendar expansion function, due to the development of
PHP Array_slice () Function Example Tutorial
Definitions and usage
The Array_slice () function returns the selected part of the array.
Grammar
Array_slice (Array,start,length,preserve)
parameter
Strlen ()
PHP strlen () function
Definitions and usage
The strlen () function returns the length of the string.
Grammar
Strlen (String)
Parameters: StringDescription: Required. Specify the string to check.
The code is as follows
The code is as follows
Copy Code
Class validation{function Check_email ($value) {//check a email addressreturn (BOOL) Preg_match ('/^[a-z0-9._%+-]+@: [a-z0-9-]+.) +[a-z]{2,4}$/i ', $value);}function Check_ip ($value) {//check A IP
First, process tracking
The code is as follows
Copy Code
# Top//Find process PID with high CPU usage# Strace-p PID//tracking process# LL/PROC/PID/FD//See which files the process is working on
There will be
The way to resolve 502 Bad Gateway is:
1. Depending on the performance of the server, in the php-fmp.conf to increase the value of Max_children, I currently use 15.
(a php-fpm uses about 20M of RAM, if your memory is about 1G,1024/20=50)
2. Use
First of all, the difference between ereg () and eregi ():
Ereg () string contrast matching function, which distinguishes string capitalization;
Eregi () string contrast matching functions, which do not distinguish between string capitalization.
Php official account js-sdk development application, php official account js-sdk
Test the js interface function. I use the BAE server instead of the SAE server. Files cannot be written to the SAE server. problems may occur during testing.What is
In linux, zlib must be enabled. The following describes how to enable this function.1. Download and install zlibHttp://www.gzip.org/zlib/Decompress the tar package and enter the directory to execute the command:./Configure & make install 2. Add the
In other windows versions The code is as follows:Copy code # Open the File.If ($ handle = fopen ("test.csv", "r "))! = FALSE ){# Set the parent multidimen1_array key to 0.$ Nn = 0;While ($ data = fgetcsv ($ handle, 0 ,","))! = FALSE ){ //
The current time obtained in the PHP script is Beijing time. Modify the PHP configuration file as follows:1. date. timezone = Etc/GMT-8// In the configuration file, set the default time zone to zone 8 (Beijing time)Add one more sentence to the
Two days ago, I said there was a PHP extension, tclip Image cropping program.Tclip is committed to face recognition and recognition of prominent areas of images. The biggest difference between Tclip and other image cropping programs is that the face
You can also directly read the content in the zip package, which is very convenient. Here we mainly summarize the process of reading and decompressing.Decompress a package to the specified directory. The code is as follows:Copy code $ Zip = new
1. Start usingFirst Download and decompress the file, and then include the simple_html_dom.php file into the script file to be compiled. Load the html to be processed. Three modes of html loading are supported: "load from url, load from a 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