PHP has had a bad reputation over the years. There is a lot of discussion about its "summary of poor design" and grammatical contradictions, but the main complaint is usually security. Many PHP sites are hacked in minutes, and even some experienced
PHP rules that start with two underscores (__) are reserved as magic methods, so it is recommended that you do not start with a function name unless you are trying to overload an existing magic method.
The Magic Methods in PHP are: __construct,
The method is very simple, here is no more nonsense, directly to the code:
Copy Code code as follows:
protected function Dir_size ($dir) {
$DH = Opendir ($dir); Open Directory, return a directory stream
$size = 0; Initial size is 0
The example of this article tells the YIIC command when the "Php.exe" is not internal or external command solutions, shared for everyone to reference. The specific methods are as follows:
In cmd run YIIC webapp work if the newspaper "Php.exe" is
PHP default upload limit is the maximum 2M, want to upload more than this set of files, need to adjust PHP, Apache and some other parameters. Below, we briefly introduce the PHP file upload some of the parameters involved:
File_uploads: Allow the
In PHP, we all know that there are special MB_SUBSTR and Mb_strlen functions that can intercept and compute the length of Chinese, but because these functions are not PHP's core functions, they are often not open. Of course, if you are using your
This article is an example of a 50-state select list of states that PHP implements. Share to everyone for your reference. Specifically as follows:
Here is a list of the 50 U.S. states that PHP generates, automatically selecting the current state
Do you use Is_file or file_exists to determine whether a file exists?
In writing procedures found in the determination of the existence of documents, there are two ways to write, some people used is_file, some people use file_exists, which better
This example describes a method that has the most frequent 10 digits in an array of PHP statistical values. Share to everyone for your reference. The specific analysis is as follows:
This problem belongs to the category of TOPK, statistics words
This article illustrates the use of PHP to obtain Web Access statistics class compete API. Share to everyone for your reference. Specifically as follows:
Here use PHP to get the site access statistics class compete api,compete is a website that is
There is only one php_pdo_odbc.dll.
So~ the newest and best PHP connection MSSQL method should be this:
Copy Code code as follows:
$CNX = new PDO ("Odbc:driver={sql Server}"; server=127.0.0.1;database=test; ", ' sa ', ' asd123 ');
During the PHP development process, you may often need to retrieve an array to get the last health or value of the array. The cloud-dwelling community here summarizes three methods and describes the limitations of how they are used in some cases,
CodeIgniter (CI, official website and China Station) is a popular PHP framework, compact but powerful, simple lightweight at the same time have a good scalability, at home is also relatively popular. CI, on the other hand, has not been with the
Krsort () Definition and usageThe Krsort () function sorts the array in reverse order, preserving the original key for the numeric value.
The optional second parameter contains the additional sort flags.
If successful, returns TRUE, otherwise
Array_combine () Definition and usageThe Array_combine () function creates a new array by merging two arrays, one of which is the key name and the other is the key value.
If one of the arrays is empty, or if the number of elements in the two
In fact, there is no technical content, of course, directly affixed to the code, no nonsense,
But in fact, the development of a very useful, such as forum posts, scarf and so have relevant applications
Copy Code code as follows:
This example describes the way PHP converts strings to 16. Share to everyone for your reference. The specific analysis is as follows:
In PHP, you can convert a string into a 16-form output using the Bin2Hex function, and the Bin2Hex () function
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