PHP5 Magic Method
Magic function:
1. __construct ()
Constructor: Called when an object is instantiated,
When a __construct and a constructor with a class name are present, __construct is called and the other is not called.
2. __destruct ()
Web site development Inevitably to store some data, but the way to store the data in various languages is basically: first open the connection, then execute the SQL statement, get the result, close the connection.
So what are the methods for PHP to
What is the exception to PHP?
PHP 5 provides a new approach to object-oriented error handling. Exception handling is used to change the normal process of a script when a specified error (exception) condition occurs. This condition is called an
For two ordered arrays, each array is looped once and ordered into the new array;
Take the idea of incrementing, comparing, and then inserting in order, PHP code:
[PHP]
$arr 1 = array (1,2,3,4,5,6,7,8);//Sample Data
$arr 2 = array
Body
debugging PHP Database Today MySQL, in the unit's computer installed phpMyAdmin database management software, originally is very simple thing, but there are a few problems:
1/Unable to load mcrypt extension, please check PHP
In this article, you can learn how to use some of the basics of the session. After reading this article, perhaps you have learned the basic usage of the session!
PHP Session variables
When you run an application, you open it, make some changes,
Describe
In PHP, you can define Session_set_save_handler to store server session data on different media, such as stored in a file, APC or memcache cache, or stored in a database. You can count the number of people online, or kick off a particular
Array_map () functions a callback function on a given array cell
functionThe function will return an array,The array contains all the cells in the array1 after the callback action.The number of arguments received by the callback callback function
The syntax for the For loop is:
Code to copy code as followsfor (EXPR1; expr2; expr3)Statement
Here are some useful variants of the for statement.
1. Infinite loop
This is called the cycle of death, no beginning or ending.
for (;;) {Placing
1. Installing the JDK
#chmod u+x Jdk-6u4-linux-x64.bin
#./jdk-6u4-linux-x64.bin
Press ' Q ' key, enter Yes in the current directory will produce a jdk1.6.0_04 directory
#mv jdk1.6.0_04/usr/local/
Configuring Environment
Introduced
For PHP performance problems, the most talked about is the __autoload () method, many people mention that this method has a significant impact on performance. Others say that opcode can also affect the __autoload () method, so I made a
after the end delimiter can be followed by a variety of pattern modifiers (in the terms of php , called pattern modifier),
In some cases, modifiers can also be present inside the regular expression, with some of the properties of the decorated
There are the following PHP code to debug:
In the debug parser unexpectedly garbled display as follows:
After all aspects of groping, find the solution as follows:
You'll need to set up a different debugger encoding, a global setting, and
User-defined functions are also called custom functions, which are not provided by PHP and are created by programmers. Because you create such a function, you have complete control over the functions. So you can have a function that works exactly as
PHP references (add & symbols before variables or functions, objects, etc.)
The reference in PHP means: Different names access the same variable content.There is a difference between the pointers in the C language. The pointer inside the C language
Many times we need to concatenate a few strings to show that in PHP, the strings are connected using "dots", which is the period "." in English, using the following method:
Defining strings
$str 1 = "Hello world!";
$str 2 = "Welcome to Hutaow
One of the reasons we use the MVC framework, such as CI, YII, CakePHP, is to make the code easier to maintain.
However, when the business logic is constantly complex, the methods that are called in the model in the controller become bloated.
The
Compare PHP and JSP two Web development technology, in the current situation is actually compared to PHP and Java Web development. Here are some of the major areas I have compared:
I. Comparison of languages
PHP is the server scripting language
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