CopyCodeThe Code is as follows: Echo 'in in time: '. $ begin = microtime (false).' '; // begin to count time
$ Array = array ();
For ($ I = 1; $ I $ Array [$ I] = $ I;
}
/*
$ Arr = $ array; // the total time for copying and printing data is 0.0
There are three common methods to traverse arrays in PHP:
1. Use the for statement to traverse the array cyclically;
2. Use the foreach statement to traverse the array;
3. Use List (), each (), and while loop to traverse the array.
Among the three
After the php. ini file is configured, all Zend paths are correctly configured, but phpinfo () does not display Zend information.
Check whether the Zend directory has the user permission. By default.
Install PHP in ISAPI mode, and you cannot
I. Error HandlingException Handling: unexpected, unexpected, occurs during the running of the program. Use an exception to change the normal process of the script.
A new important feature in PHP5
Copy codeThe Code is as follows: if (){
} Else
Php web page garbled characters are generally caused by different encoding used during database creation and php Web page encoding,
If you do not specify the encoding for a database created using phpmyadmin, the default encoding is
Now we start our PHP coding journey in the Linux world. There will be various problems in coding, and the time to solve the problem is also the time for us to change from new to New.
Every programming language starts from the variable. PHP is a type
I actually called a zend database access method and used the fetchAll method. However, because this record is not found in the database, the returned object is null, so I will judge whether the object is null:
Copy codeThe Code is as follows: if (
You do not have to strictly abide by these principles and violate them and are not subject to religious penalties. However, you should regard these principles as warning bells. If you violate one of them, the warning bells will ring. ----- Arthur J.
You can define a call method on the page as follows:
Copy codeThe Code is as follows: function getData (){
$. GetJSON ("http: // 123.123.123.123 /? Callback =? ",
{
"M": "data", // specify the php file name
"Act": "getdata", // specifies the method
The value of register_globals can be set to: On or Off. Let's take a piece of code to describe their differences.Code:
Copy codeThe Code is as follows:
When register_globals = Off, when receiving the next program, use $ _ GET ['user _ name']
Method 1:
Copy codeThe Code is as follows: Require_once ("./config. php ");
Ob_start ();
$ Id = $ _ GET [id];
$ SQL = "select * from table_name where id = '$ id '";
$ Result = mysql_query ($ SQL );
$ Rs = mysql_fetch_object ($ result );
$ Smarty->
In PHP 4.2.0 to 4.2.3, you can use the w32api_register_function to call an external DLL, provided that you need to open the extended php_w32api.dll in php. ini.
If PHP 5 is used, only the php com class is used to call the DLL.
Basic Method: $ obj =
Today, I learned some basic SQL Injection skills from the Internet. The focus of SQL injection is to construct SQL statements. Only SQL statements can be used flexibly.
Statement can be used to construct the cou injection string. After completing
I. String insertion
Difference between double quotation marks and single quotation marks:
1. Use of double quotation marks:
Copy codeThe Code is as follows:
// Double quotation marks can parse variables and escape characters
$ Username = "jack
What is php:
PHP is short for Hypertext Preprocessor. PHP is an embedded HTML language. It is a scripting language that executes HTML documents embedded on the server. It is widely used in a style similar to C language.Php is the background commonly
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