When writing the form verification class of the framework tonight, you need to determine whether the length of a string is within the specified range. Naturally, you think of the strlen function in PHP. $ Str & amp; #39; Helloworld! & Amp; #39;
1. It is quicker to use single quotes instead of double quotes to contain strings. Because PHP will search for variables in a string surrounded by double quotes, single quotes will not, note: only echo can do this, it is a string can be used as a
PHP cannot but look at the 50 details!1. It is quicker to use single quotes instead of double quotes to contain strings. Because PHP will search for variables in a string surrounded by double quotes, single quotes will not, note: only echo can do
PHP's unique syntax mixes C, Java, Perl, and PHP's self-innovative syntax. It can perform dynamic Web pages more quickly than CGI or Perl. Dynamic pages made with PHP are embedded in HTML documents to execute, compared to other programming languages,
1. It is quicker to use single quotes instead of double quotes to contain strings. Because PHP will search for variables in a string surrounded by double quotes, single quotes will not, note: only echo can do this, it is a string can be used as a
IntroductionThe English copyright belongs to Reinhold Weber, translated by yangyang (aka David koree ). The bilingual version can be used for non-commercial communications, but must contain the English version of the author, copyright information,
1, if the method of the class can be defined as static, as far as possible to define as static, it will increase the speed of nearly 4 times times.2. The speed of $row [' ID '] is 7 times times that of $row[id].3. Echo is faster than print, and uses
1. In the case of file_get_contents instead of file, fopen, feof, Fgets and other series of methods, try to use file_get_contents, because he is much more efficient! But pay attention to file_get_ Contents PHP version problem when opening a URL file;
Php built-in functions exec and system can call system commands (shell commands). Of course, there are also passthru, escapeshellcmd and other functions.
In many cases, using the exec, system, and other functions of php to call system commands can
Smarty3 configuration and entry syntax, smarty3 entry syntax
1. Smarty3 Configuration
Download the Smarty File
Download the Smarty file from the Smarty official website, decompress the downloaded Smarty file, and the Smarty library file is in the
Using single quotes instead of double quotation marks to contain strings can be faster. Because PHP searches for a variable in a string surrounded by double quotes, the single quotation mark does not, note: only echo can do this, it is a "function"
Using single quotes instead of double quotation marks to contain strings can be faster. Because PHP searches for a variable in a string surrounded by double quotes, the single quotation mark does not, note: only echo can do this, it is a "function"
The following summarizes the optimization habits that can be done in 18 php code writing to maximize the speed of php code execution!
(1) The static method is four times faster than the normal method.(2) echo output is faster than print(3) Use the
Use single quotes instead of double quotes to include strings, which is faster. Because PHP will search for variables in strings enclosed by double quotes, but not in single quotes. Note: Only echo can do this, it is a "function" that can treat
To meet this requirement, an array $ data = array (12, 43, 87, 45) requires a user-defined function to be written to separate the numbers of its array elements, the final array is as follows: $ data = array (1, 2, 4, 3, 8, 7, 4, 5 ). The number in
Improve PHP Programming Efficiency tips: MRR font: [Increase decrease] Type: Reprint time: 2015-08-13 PHP is the world's most widely used development language, PHP and Linux, Apache, MySQL tightly combined to form a lamp of open-source gold partner.
Just the output variable does not meet the needs of the template output, the built-in template engine supports the use of the template variable regulator and formatting functions, in fact, provide function support, and support the use of multiple
This article mainly describes how to obtain the value of the first array unit of an array in php. In php built-in functions, the functions used to obtain array element values mainly include the reset next current prev end functions.
Reset (PHP 3,
Recently, my webmaster is also learning PHP, so I want to organize some tips in PHP development for you to learn.
0. replace double quotation marks with single quotes to include strings. This will be faster. Because PHP will search for variables in
Use php to simulate the ping command of the commonly used doscommand. Here, we mainly use the php built-in function exec to call the system's ping command to implement the ping command function.Copy codeThe Code is as follows:$ To_ping = 'www
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.