A simple answer is obviously pale and powerless. Let's make an experiment today to see what is the difference between single quotes and double quotes, who is fast and who is slow.
Test
Code As follows:
Copy code The Code is as follows: $
PHPCode $ Id = intval ($ _ Get ['id']);
Intval (PHP 4, PHP 5)
Intval-get the integer value of a Variable
Description
Int intval (mixed $ var [, int $ base = 10])
Returns the integer value of VaR, using the specified base for the conversion
Recommended functions:
First, PHP obtains the URL of the current page: dedecms also uses this
CopyCode The Code is as follows: // obtain the current Script URL
Function getcururl ()
{
If (! Empty ($ _ server ["request_uri"])
{
$ Scriptname = $ _
This function has been used for obtaining:
CopyCode The Code is as follows: function microtime_float (){
List ($ USEC, $ Sec) = explode ("", microtime ());
Return (float) $ USEC + (float) $ Sec );
}
We can see that microtime (true) is used in
PHP ftp transfers files to the server
CopyCode The Code is as follows: // Start
$ Ret = ftp_nb_get ($ my_connection, "test", "readme", ftp_binary,
Filesize ("test "));
// Or: $ ret = ftp_nb_get ($ my_connection, "test", "readme ",
// Ftp_binary,
(1) All data should be hidden inside the class.(2) A class user must depend on the common interfaces of the class, but the class cannot depend on its users.(3) Minimize messages in the protocol of the class.(4) implement the most basic public
Sometimes this error message suddenly occurs when phpMyAdmin is used.
"You cannot create a session when an error occurs. Check the PHP or website server logs and correctly configure PHP installation"
I don't know how it actually caused this
Note: php does not limit the length of string. The only limit is the available memory of PHP on the computer (value of the memory_limit variable in the PHP. ini file)
There are four methods to limit the string range:
1. Single quotes;
2. Double
Requirements:
1. There is one set of svn code locally (the editor UltraEdit) and one set of code on the development machine (centos). You need to modify the local code and then upload it to the development machine.
2. It is not directly modified
Data Encryption has become more and more important in our lives, especially considering the large amount of data that has been traded and transmitted over the Internet. For information that does not need to be restored to the original data, we can
Copy codeThe Code is as follows: /*
* 1. array Overview
* 1. The essence of Arrays: managing and operating a group of variables, batch processing
* 2. array composite type (multiple objects can be stored)
* 3. Data of any length or type can be
The following is a one-to-one introduction.
1. echoEcho is a keyword of PHP, and it does not return a value. In terms of writing, it can omit parentheses. The following code:
Copy codeThe Code is as follows: echo 'test string ';
Echo ('test string '
1. When file_get_contents can be used to replace file, fopen, feof, fgets, and other methods, use file_get_contents as much as possible because of its high efficiency! Note the PHP version of file_get_contents when opening a URL file;
2. Perform as
I. ExamplesA. A variable is not defined. How should we judge it?
Copy codeThe Code is as follows: # $ Test variable does not exist
$ Isset = isset ($ test )? "Test is define! ":" Test is undefine! ";Echo "isset: $ isset \ r \ n ";
$ Empty =! Empty (
If you are not planning to create an application using the OO principle, use the object-oriented (OO) Language Features of PHP, these seven habits will help you begin to convert between process programming and OO programming.In the early days of PHP
1. object-oriented concepts
Object-Oriented Programming (Object Oriented Programming, OOP, Object-Oriented Programming) is a computer Programming architecture, one basic principle of OOP is that a computer program is composed of a single unit or
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