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
Recently webmaster himself is also learning PHP, so some of the small PHP development tips out for everyone to learn.
0. It is quicker to use single quotes instead of double quotes to contain strings. Because PHP will search for variables in a
PHP uses the Fgetcsv () function for data in CSV format.
Use the following statement
$hd =fopen (' test.csv ', ' R '); $buf =fgetcsv ($HD, 1000, ', ');Opens a Test.csv formatted file with the contents of the file separated by the "," number.
The
0. 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 source code] explode and implode functions, explodeimplode. [PHP source code] explode and implode functions, explodeimplodeexplode and implode functions are mainly used for conversion between strings and arrays, for example, after a parameter
[PHP source code reading] explode and implode functions, explodeimplode. [PHP source code reading] explode and implode functions, explodeimplodeexplode and implode functions are mainly used for string-Array Operations. for example, after obtaining a
Suggestions for optimizing PHP code and suggestions for optimizing php code. Suggestions for optimizing PHP code. Suggestions for optimizing php code 1. if you can define a class method as static, try to define it as static, which will speed up to 4
High-efficiency PHP 0. use single quotes instead of double quotation marks 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
PHP string length function, in PHP test string length function has two, one is strlen, the other is Mb_strlen before a default is supported, the latter need to open a plug-in, let us introduce the difference between the two functions and application
Definition and usage
The
strlenThe length string returned by the () function.
His function is to calculate the length of the word character, Chinese one word is 2Grammar
Strlen (String)
Parameter
Description
String
This program code has the "IP address forgery" vulnerability. how can this problem be solved? PHP interview questions, including php Basics, mysql, network, and front-end knowledge
Php Basics
1. what are the output results of the following php
I want to share with you my score for the first two hours of learning php (suitable for beginners): PHPcodewww.w3school.com. cnphp1.php. the file must be: & lt ;? Write the php statement here? & Gt; 2. echo output function method: echo "abc" 3.
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
Sometimes we need to calculate the number of words contained in a string, for pure English strings, the number of words equals the string length, with
The Strlen function is available, but what if the string contains Chinese? Mb_strlen can be
Strdup function usage
Function Name: strdup
Function: copy the string to the new position.
Usage: char * strdup (char * Str );
This function is explained in the Linux man manual as follows:
The strdup () function returns a pointer Toa new string
Class constructor, destructor, and value assignment function
Constructors, destructor, and assignment functions are the most basic functions of each class. They are so common that they are easy to paralyze. In fact, these seemingly simple functions
Handle exceptions caused by the Abort FunctionAbs function absolute value functionThe AddExitProc function adds a process to the End Process Table of the runtime database.The Addr function returns the address of the specified object.The
Unicode: Wide-Byte Character Set1. How to obtain the number of characters in a string that contains both single-byte and double-byte characters?You can call the Runtime Library of Microsoft Visual C ++ to contain the function _ mbslen to operate
1: first, change the project attribute to a multi-byte character set.2: For all l "strings", remove L, or change to => _ T ("string ")PS1: _ t is an automatically replaced macro. It can be replaced with something different based on the Compilation
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.