This is what I found in the process of doing the enterprise station Some of the differences: (for reference only)
One, $_server[' server_name '] under the Windows system, there is/at the end, Linux does not have/. You can use the following methods
Share a very practical, I have been using the PHP pop-up warning function, sorted into their own code base in the encounter where the error can be used to the function, extensibility, complete code as follows
Copy Code code as follows:
Pop-
Copy Code code as follows:
[Mail Function]
; For Win32.
SMTP = mail3.focuschina.com
Smtp_port = 25
; For Win32.
; sendmail_from = me@example.com
Just configure the code as above, not using the username and password,
If the URL is a http://www.jb51.net/p1141.html form, it can be analyzed by the difference between the $_server[' Request_uri ' and $_server[' query_string ' values, The main thing is that if a page is redirected by a $_server[' redirect_query_string
There is a parameter Curlopt_returntransfer in the curl:
Copy Code code as follows:
curl_setopt ($ch, Curlopt_returntransfer, 0);
By default, 0 returns the text stream of the obtained output directly, sometimes it is not good to use the
Definitions and usageThe Number_format () function formats a number by a thousands group.
GrammarNumber_format (Number,decimals,decimalpoint,separator)
Parameter descriptionNumber required. The number to format. If no other parameters are set, the
About the file code detection, Baidu a lot of it is, but there is no use,
Many people suggest mb_detect_encoding detection, but I do not know why this is not successful, nothing output,
See someone wrote an enhanced version, with the BOM to judge, I
Implementation code:
Copy Code code as follows:
function Addslashes_deep ($value)
{
The most classic recursion in history, one line.
Return Is_array ($value)? Array_map (' Addslashes_deep ', $value): Addslashes ($value);
}
Parameter description of PHP Setcookie function
Usage:
Setcookie (Name,value,expire,path,domain,secure)
Parameter description
Name required. Specify the name of the cookie.
Value required. Specify the value of the cookie.
Expire optional.
Gzip can compress the size of the page to speed up the opening of the Web page, the current mainstream browser almost all support this feature, but the open gzip is required to support the server, where we simply use PHP to determine whether the
Recently in PHP to do about socket communications related content, found that a lot of people on the network in the understanding of how to carry out 16 to send and receive, research, the code is as follows, welcome to Pat Bricks.
Copy Code
Copy Code code as follows:
Ini_set ("Memory_limit", "50M"); must, according to your environment of the actual situation as large as possible, to prevent errors
Ini_set ("Max_execution_time", "100");
The file_exists () function checks whether
1. IssetFunction: To determine whether a variable is initializedDescription: It does not determine whether the variable is empty and can be used to determine whether the elements in the array have been definedNote: When using isset to determine
No more nonsense, just go to the code.
Copy Code code as follows:
Public Function Export_data ($data = Array ())
{
# code ...
Include_once (app_path. ' tools/phpexcel/classes/phpexcel/writer/iwriter.php ');
Include_once (app_path. '
Characteristics of static local variables:
1. Does not change as the function is invoked and exited, however, although the variable continues to exist, it cannot be used. If the function that defines it is invoked again, it can continue to be used,
Requirements are as follows: There is an existing 1G log file, about more than 5 million lines, with PHP to return the contents of the last few lines.
1. Directly using the file function to operate or file_get_content () Positive report memory
$_server[' php_self '] #当前正在执行脚本的文件名, associated with document root.
$_server[' argv '] #传递给该脚本的参数.
$_server[' argc '] #包含传递给程序的命令行参数的个数 (if run in command line mode).
$_server[' Gateway_interface '] #服务器使用的 the version of the CGI specification.
1, the basic principle of PHP injectionThe level and experience of programmers are also uneven, a large number of programmers in the code, not the user input data to judge the legality, so that the application has security problems. Users can submit
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