Phpquery How to handle excessive memory consumption
Resolves an issue in which phpquery consumes too much memory
Phpquery is a jquery-like open source project implemented in PHP that parses web page elements in the form of jquery in the
Five tools a programmer must learn to use
1, Svn_delete
A tool to delete svn information, very easy to use, completely remove SVN information.
2. Search and Replace
Find and replace tools. This tool for long time not to look at the project
When converting the encoding, there is a page that needs to declare the UTF-8 encoding in the head, but this conflicts with a header in the program. Google a bit, find a few solutions, translation collation:
If you got the message: "Warning:cannot
The role of Ob_start () Ob_end_flush ()
Introduction to the new function of PHP4-Output information control function
These functions allow you to control the content of your script output. It can be used in many different situations, especially if
How to automatically generate version information in a PHP document
When looking at some of the PHP source code, you can often see some very standard annotation information$Id: database.php 4343 2009-05-08 17:04:48z Jheathco $This information
PHP Efficient directory traversal, no recursion, no directoryiterator
Add: The parameters passed $dir to the absolute path to traverse the directory,
/** Quick Find directory, file */public static function find ($dir) {if (!is_dir ($dir)) # If
Several methods of implementing timed tasks in PHP
These days need to use PHP to write a timed crawl Web server application. Search on the Internet for a solution, found Oschina a question of the answer is wonderful
Several solutions are
Get_headers () is a PHP system-level function that returns an array containing the headers sent by the server in response to an HTTP request. If it fails, it returns false and emits an e_warning level error message (which can be used to determine if
PHP garbled problem Summary and solution
Garbled has always been a very big problem for PHP beginners, and now summarizes the reasons for the PHP website garbled and Solutions :
First, HTML page encoding:
Meta Http-equiv=content-type
How to improve PHP project development skills?
First of all, PHP development should pay attention to the following points:1.PHP page code sharing, PHP source is loaded into memory once, in which to retain-this with the APC and Zend Optimizer can be
1, PHP class method as far as possible static, speed can be increased by 25%;
2, try to use the ternary operator (? :)
3. Use the error_reporting (0) function to prevent potentially sensitive information from being displayed to the user
The ideal
Sometimes we need to change the ID of the URL into a non-1,2,3,4 such a regular content, we can use the Hashids this class library.
The generated IDs are taller, compared with ID names like Youtube, Youku, Weibo, and so on, such as: Xnjkxmtc0mdq4
I. Defining a cookie Storage path
Absolute path must be used
$cookie _jar = dirname (__file__). " /pic.cookie ";
Second, access to cookiesDepositing a cookie into a file
$url = "http://1.2.3.4/"; 2. $ch = Curl_init ();curl_setopt ($ch,
1. Careful analysis of clear questions and objectives
2. Think hard about how to solve this problem
3, collect and collate all the information to solve the problem.
Take the time to write down the goals that the final product is going to achieve and
RMB Digital to Chinese capital, is a more common demand, so here to share a function, also counted as a record, in case you will use later!
function Num2rmb ($num) {$c 1 = "0 One and three Woolu qi Ba Jiu"; $c 2 = "split-angle element pick Bai
For the day IP is not high or the number of concurrent is not a very large application, generally do not consider these! There is absolutely no problem with the normal file operation method. However, if the concurrency is high, when we read and
Sorts a two-dimensional array by the specified key value.
/*Function: The two-dimensional array is sorted by the specified key valueAuthor:www.scutephp.com*/function Array_sort ($array, $keys, $type = ' asc ') {if (!isset ($array) | |!is_array
The following error message may appear in the future PHP environment of PHP5.4:
Notice:only variable references should be returned by reference
Exactly what kind of script would make such a mistake, I would like to give an example:
The
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