Almost match any URL:
CopyCode The Code is as follows: ^ (HTTPS? | FTP | News ):\/\/)? ([A-Z] ([a-z0-9 \-] * [\.]) + ([A-Z] {2} | aero | ARPA | biz | com | Coop | Edu | Gov | info | int | jobs | mil | museum | Name | NATO | net | org | Pro |
First, go to the source code directory.CD php-5.2.13/EXT/ftp
# Run phpize to generate configure/Usr/local/PHP/bin/phpize
# Compile and specify PHP-config. Note that the PHP-config here is not PHP. ini../Configure -- With-PHP-Config =/usr/local/PHP/
After the PHP variable is declared and assigned a value, the variable name exists in the symbol table, and the value and class information exist in zval. zval contains four variables,Is_ref, refcount, value, type, zvalThe source code is as
The last time we talked about refcount and is_ref, we will talk about memory leakage.Copy codeThe Code is as follows: $ a = array (1, 2, & $ );Unset ($ );
In the old PHP version, memory leakage occurs. The analysis is as follows:
Run the first line
Buffer
Buffer is a memory address space. The default size of a Linux system is generally 4096 (4 kb), that is, a memory page. It is mainly used for data transmission between devices with Different Storage speeds or devices with different priorities.
In many cases, in order to display the timeliness of information, the time is usually displayed as "just", "5 minutes ago", "3 hours ago", and so on, instead of printing the time directly. For Weibo, SNS applications use this function for the
Definition and usageThe htmlspecialchars () function converts some predefined characters into HTML objects.
The predefined characters are:• & (And number) become &• "(Double quotation marks)"• '(Single quotes)'• •> (Greater than)
Php downloads files, such as txt files.The result is that the browser's built-in download box is displayed, and the Save As operation is displayed. Sometimes memory overflow and timeout may occur.
If timeout occurs, Set
Set_time_limit (0 );Memory
Because the current browser can recognize the txt document format, if only a text link is provided for the txt document, the content of the txt file is displayed in a new window after clicking it, click Download cannot be implemented. Of course, the
Php can use set_time_limit (0); to cancel the php step timeout limit, so as to achieve the effect of persistent connections.
The sample code is as follows:
Copy codeThe Code is as follows:
Echo "output once every 3 seconds ";
Set_time_limit (0); //
Today, I sorted out the program code about uploading files and displaying the progress bar, and optimized the code. Solve the problem that has been plagued: Sometimes the progress bar does not reach 100%, and the browser is suspended. The tests in
In the beginning, I want to directly disable access to URLs with php Suffixes in rewrite rules. However, we later found that the rewrite rules were recursively called. If php is directly forbidden in the rewrite rules, the rules for rewriting to php
1. Time Conversion Function in php
Strtotime ("today ")
Date ("Y-m-d H: I", $ unixtime)
2. Obtain the timestamp of today's in php.
To obtain the unix timestamp at zero point, you can use $ todaytime = strtotime ("today "),
Then use date ("Y-m-d H: I"
The code is simple and involves the use of the header function. The Code is as follows:
Copy codeThe Code is as follows: If (! Empty ($ _ SERVER ['https']) & ('on' ==$ _ SERVER ['https']) {
$ Uri = 'https ://';
} Else {
$ Uri = 'HTTP ://';
}
$
Copy codeThe Code is as follows:
obtain Server Information
$ Sysos = $ _ SERVER ["SERVER_SOFTWARE"]; // gets the string of the SERVER ID
$ Sysversion = PHP_VERSION; // get the PHP server version
// The following two codes connect to the MySQL
Copy codeThe Code is as follows: $ a = "string ";
$ C = explode ("text to be deleted", $ a, 2 );
$ B = $ c [0]. $ c [1];
Explode(PHP 3, PHP 4, PHP 5)
Explode -- use one string to separate another stringDescriptionArray explode (string separator,
In php, the quickest way to read files is to use functions such as file and file_get_contents, A few simple lines of code can perfectly complete the functions we need. However, when the operated file is a relatively large file, these functions may
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