The PHP ob_start () function is a powerful function that can help us solve many problems.
The Output Control function allows you to freely Control the Output of data in the script. It is very useful, especially when you want to output the file
Merge Arrays
The array_merge () function combines arrays and returns a union array. The obtained array starts with the first input array parameter and is immediately added according to the order in which the following array parameters appear. The
In some cases, you need to know the generated ID after executing the INSERT operation on the database (the primary key of MySQL is AUTO_INCREMENT, when you perform the insert operation, you do not need to specify the ID value and the database will
Modify the session expiration time in php to modify the session. gc_maxlifetime in the php configuration file php. ini.
Each time php sends a request, it has a 1/100 probability (default) to trigger "session reclaim ". If "session Recycle" occurs,
In the previous article, I introduced some situations of the header () function in PHP. I would like to add it here.
The following describes how to use the header function:
No matter how many headers there are on the page, it executes the last one,
Recently, I feel that the database pressure on my website is quite high, which causes the website to speed down very quickly. Because a considerable number of pages are directly connected to the database to read data, this part of pages is also
RSS aggregation is very popular recently, so at least understanding RSS and its working methods is an urgent need of a PHP developer. This article introduces the basic knowledge of RSS, some usage of RSS for many purposes, How to Use PHP to create
To remove duplicate values from an array, you can use the foreach method or the array_unique method. The following code uses both methods.
";$intStart1 = time();$arrRS = array_unique($arrT);$intEnd2 = time();$intTime2 = $intEnd2-$intStart1;echo
In PHP, arrays are divided into two types: Numerical index arrays and associated arrays. The numeric index array is the same as the array in C language. The subscript is 0, 1, 2... The subscript of the correlated array may be of any type, which is
The principle of automatic loading is that Zend_Loader_Autoloader is used in the Zend_Application instance to call spl_autoload_register (array (_ CLASS __, 'autoload ')); in this way, if the class cannot be found, the autoload method of this object
We have discussed the design principles of IoC control reversal. Now we use PHP to implement IoC design principles and deepen our understanding of this concept.
First, compile the POJO and Fruit interfaces of Fruit. Inherit from the Fruit interface
Static Method rules are the same as static variables. You can use the ststic keyword to identify a method as a static method. You can use the class name and scope-limiting OPERATOR: You can access a static method.
There is an important difference
Because Weibo has a word limit, if you send a website, it will be automatically changed to a short website. My previous articles introduced how to convert a web site into a short Web site. Here we will, in turn, restore the short Web site to the
The Singleton mode is a creation mode. It is the simplest mode in the design mode. Of course, it is used everywhere.
The Singleton mode ensures that a class has only one instance and provides a global access point to access it.
When you need to
File signatures are generally in the file header. If you view the file in hexadecimal mode, you can see some signature information of the file. For example, if you use uestudio to view zip files in hexadecimal format, the file content header
Sometimes, garbled characters occur when you use the file_get_contents () function to capture webpages. There are two possible causes for garbled characters: encoding and Gzip on the target page.
Encoding Problems are easy to solve, just encode the
I sorted out a written question from a PHP senior engineer, with comprehensive questions. Well, basically all these questions are well answered, so you should be competent for the PHP job of most Internet companies. The following is a question.1.
1. for rapid development, you can consider using the MVC framework.
Using MVC frameworks such as CodeIgniter is very effective in rapid development. MVC frameworks do not force you to write object-oriented code. They only separate php code from html.
Introduction to cookies and sessions
In many cases, we need to track the activities of visitors on the entire website and automatically or semi-automatically identify their identities (that is, the usual website login and other functions). At this
When we write a program, it is inevitable that there will be problems (which often occur). When PHP encounters an error, it will give the location, number of lines, and the cause of the error script. Many people say that this is no big deal. Indeed,
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