Add new methods to class dynamically without Runkit in PHP5.2
The objects in JS can be dynamically added to the method. You can add a method to a class by using Runkit in PHP5.2. And to php5.3, added the closure syntax. You can add methods
Several commands related to the PHP environment
To view the modules loaded by PHP:
Php-m
To view the configuration file for the PHP environment:
PHP--ini
This command lists all of the PHP configuration files. There may be multiple php.ini in a
How PHP intercepts a string and zeros the Str_pad () function
Definition and usage
The Str_pad () function fills a string with the specified length.
Grammar
Str_pad (String,length,pad_string,pad_type)
Parameters
Description
PHP: The difference between:,-, self, $this operator
When accessing a member variable or method in a PHP class, if the referenced variable or method is declared as const (defining a constant) or static (declaring static), then the operator must be
Add-Lock under PHP concurrent operation
How PHP solves multiple threads reading and writing the same file
As we all know, PHP is not a multi-threading concept, although we can still use the "imperfect" method to simulate multithreading. simply put,
PHP regular match image path see Preg_match_all () function usage
PHP regular match image path see Preg_match_all () function usage.First look at the PHP code:$ext = ' gif|jpg|jpeg|bmp|png ';//list the image suffix to achieve multiple extension
thinkphp Protection Template File
Core tip: Because the template file may reveal the Data table field information, there are two ways to protect your template file is not access to: the first way is to configure the. htaccess file, the thinkphp
Java-style overloading in PHP
Sometimes it is convenient to have the same method that can invoke variable parameters. PHP's ability to define optional parameters with default values makes this possible.
This method overload can be implemented in
PHP references (&) detailed records
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
PHP gets client information class
Getlang (); Language for visitors: Simplified Chinese, Traditional Chinese, English. $obj->getbrowser (); Get the Guest browser: MSIE, Firefox, Chrome, Safari, Opera, other.
PHP Tips (2)-Extract () method
Definition and usage
The PHP extract () function imports variables from the array into the current symbol table.
For each element in the array, the key name is used for the variable name, and the key value is used
PHP Array Learning Record (1)
Some methods for arrays
$test _arr = Array (' name ' = = ' Test ', 2 = 2, ' color ' = ' red '); Echo ' uses the Var_dump method to output an array: '; Var_dump ($test _arr); Echo 'Output array using the Print_r method:
Remote Debugging PHP
First make sure that the server correctly installs the Zend debugger. Can be viewed with phpinfo. And there are dummy.php files in the root directory of the server. In addition, you need to change the server's php.ini, the
?
Shanghai Grand PHP engineer Face test
Source: http://www.iteye.com/topic/833480
Yesterday to Shanghai Grand interview, apply for PHP engineer.
10 minutes early to the first floor of the hall, the gate and access to the door has 2 guards, as if a
Solution to the limitation of PHP execution time
?? ? These days found a small campus online loophole, so want to use PHP's Curl library to dig down all the pictures of our school, so wrote a script. But the implementation of the time found that,
PHP contains file path issues
??? Recently just learning PHP, in doing a small project, with a lot of require and include, by the absolute path, the relative path of the burn, finally figured out.
?
??? 1, the relative path of PHP is based on the
Phpcodebeautifier Use and Installation
1. Download PHPCB http://www.waterproof.fr/products/phpCodeBeautifier/2. After decompression, put the Phpcb.exe inphpedThe installation directory3. OpenphpedTools-settingsAfter finding the integration
Windows Nginx +php Configuration
The configuration of Nginx +php under Windows is relatively simple:
1, first download and install PHP, version at least 5.0 (mainly to PHP version support FastCGI method, including Php-cgi.exe can ), modify php.ini
Background query for a sub-table
I am doing a backstage, management post reply, because a lot of replies, the back end of the database is divided into a table,
Now there is a need in the background, the product can be based on the time to review
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