PHP Common functions

Source: Internet
Author: User
Tags glob

Pack ()Pack () can save storage space by converting the 32-bit 16 binary string returned by MD5 () to a 16-bit binary string.Sys_getloadavg ()SYS_GETLOADAVT () can obtain the system load condition. The function returns an array of three elements, each representing the average load for the system in the past 1, 5, and 15 minutes. Instead of letting the server down because of high load, it is better to die out a script when the system is heavily loaded, Sys_getloadavg () is used to help you achieve this function. Unfortunately, this function is not valid under Windows.Get_browser ()Is it good to see what the user's browser can do before sending the page? Get_browser () can get the user's browser type, as well as the features supported by the browser, but first you need a Php_browscap.ini file to make a reference file for the function. It is important to note that the function of the browser is based on the general characteristics of the browser. For example, if a user turns off browser support for JavaScript, the function is not aware of this. However, the function is accurate in judging the browser type and OS platform._()Wordcodess developers are often able to see this function, and _e (). The functions of the two functions are the same and are used in conjunction with the GetText () function to enable multilingual Web sites. Refer to the relevant section of the PHP manual for details.Cal_days_in_month ()Cal_days_in_month () is able to return the number of days in a specified month.debug_print_backtrace ()This is a debugging function that can help you find logic errors in your code. To understand this function, just look at an example:Metaphone ()This function returns the Metaphone value of the word, with the same pronounced word having the same Metaphone value, which means that the function can help you determine whether the two words are pronounced the same. But the Chinese is ineffective ...Natsort ()Natsort () can arrange an array in a natural sort methodLevenshtein ()Levenshtein () tells you the "distance" between the two words. It tells you how many letters you need to insert, replace, and delete if you want to turn one word into another.glob ()Glob () will make you feel stupid to find files with Opendir (), Readdir () and Closedir ().

PHP Common functions

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.