PHP has been developing for a long time and many users are familiar with PHP. Here I will share my personal understanding and discuss it with you. The PHP. ini file is believed to be unique to every PHP enthusiast. It is named PHP3.INI in the
When you are a beginner in PHP, you may encounter PHP naming problems. Here we will introduce the naming rules of PHP, hoping to help you. Careful friends can remember to keep them as future learning materials.
1. Suitable PHP naming rules
Naming is
Through1. Default call method of php curl, access url in get Mode
....
$Ch=Curl_init();
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, $ header); // sets the http header
Curl_setopt ($ ch, CURLOPT_ENCODING, "gzip ");// Set the client to support
Let's create a new array for the PHP array Processing Function array.
Array_walk: allows a user-defined function to process every element in the array.
Arsort: sorts the array values from large to small.
Asort: sorts the array values from small
1. If a method can be static, it will be declared as static. PHP code optimization speed can be increased to 4 times.
2. echo is faster than print.
3. Use multiple echo parameters instead of periods to replace string connections.
4. determine the
ThroughThe code for calculating the page execution time in PHP is as follows:
Php
Class runtime
{
Var $StartTime=0;
Var $StopTime=0;
Function get_microtime ()
{
List ($ usec, $ sec) = explode ('', microtime ());
In many advanced languages,Syntax: int ereg (string pattern, string, array [regs]);
Returned value: integer/Array
Function Type: Data Processing
Description of PHP function ereg ()
This function uses the pattern Rule to parse and compare strings.
Syntax: string sprintf (string format, mixed [args]...);
Return Value: String
Function Type: Data Processing
The PHP function sprintf () is used to format strings. The format parameter is the conversion format, starting with the percent sign % to
Description and explanation of the PHP extension Library:
Php_bz2.dll bzip2 compression function library nonePhp_calendar.dll built-in calendar conversion function library since PHP 4.0.3Php_c2.16.dll no ClibPDF function libraryPhp_crack.dll
PHP code performance optimization 1. Do not copy variables at will
Sometimes, to make PHP code more clean, some new PHP users (including me) will copy the predefined variables to a variable with a shorter name, in fact, the result is a doubling of
1. file encoding: indicates the encoding of the page file (.html,. php, etc. Notepad and Dreamweaver automatically recognize the file encoding when opening the page, so there is no problem. ZendStudio does not automatically recognize the encoding.
How to reverse the order of the last PHP string involves three knowledge points:
1. ceil () function: returns an integer. For example: 5/4 = 1.25, ceil (5/4) = 2, whether or not the decimal point is greater than 0.5, they all enter an integer.
2.
We are usingResult: Array ([0] => 1 [1] => 2 [2] => 3 [3] => 4)
Definition and usageThe str_split () function separates strings into arrays.
Length indicates the number of strings.
Str_split (string, length) the default length is 1. If it is
For the first contact with the PHP $ _ FILES array, the content is as follows:
$ _ FILES ['myfile'] ['name'] original name of the client file.$ _ FILES ['myfile'] ['type'] indicates the MIME type of the file, which must be supported by the browser,
PHP operators are the most commonly used in our programs. I recently read a PHP book to introduce the use of PHP operators. I would like to share them with you here.
1: Arithmetic Operator:-:-$ A: returns the negative value of.+: $ A + $ B addition:
With the rapid development of PHP, its functions become more and more powerful. PDO (PHP Data Object) is a new feature of PHP 5. When PHP 6 is coming out, PHP 6 only uses PDO to process databases by default. All Database extensions will be moved to
When you useThe following example demonstrates how to use the PHP function array_push () to add elements to the end of an array:
$FruitArray=Array("Apple", "orange", "banana", "Peach", "pear ");
/* Use the array_push () function to
When you use the PHP function require () to include an external PHP file, as long as the PHP file is executed, the content of the external file will be included in the PHP file. When an error occurs for the contained external file, the system will
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