Php function accumulation summary

Source: Internet
Author: User
Tags acos asin binary to decimal crc32 decimal to binary md5 hash natural logarithm sha1 hash
Math function: 10 commonly used values. Abs & mdash; absolute value: acos & mdash; arccosine: ACO & mdash; archyperbolic cosine asin & mdash; arcsin asinh & mdash; archyperbolic sine atan2 & mdash; the arc tangent of the two parameters atan & mdash; arc tangent atanh & mdash; reverse hyperbolic tangent ba

Math function:
10 commonly used red labels.

Abs-absolute value
Acos-arccosine
Acossh-inverse hyperbolic cosine
Asin-arcsin
Asinh-Inverse hyperbolic sine
Atan2-arc tangent of two parameters
Atan-arc tangent
Atanh-antihyperbolic tangent
Base_convert-convert a number between any hexadecimal values
Bindec-Convert binary to decimal
Ceil-integer in one method
Cos-cosine
Cosh-hyperbolic cosine
Decbin-decimal to binary
Dechex-decimal to hexadecimal
Decoct-decimal to octal
Deg 2rad-converts degrees to radians
Exp-calculate the e index
Expm1-returns exp (number)-1. even if the number value is close to zero, the exact result can be calculated.
Floor-rounding
Fmod-returns the remainder of the floating point number of the division.
Getrandmax-display the maximum possible values of a random number
Hexdec-hexadecimal conversion to decimal
Hypot-calculates the oblique edge length of the angular triangle
Is_finite-determine if it is a finite value
Is_infinite-determines if it is an infinite value
Is_nan-determine whether it is a valid value
Lcg_value-composite linear coequal generator
Log10-base-10 logarithm
Log1p-return log (1 + number), even when the number value is close to zero, the accurate result can be calculated.
Log-Natural logarithm
Max-find the maximum value
Min-find the minimum value
Mt_getrandmax-display the maximum possible value of a random number
Mt_rand-generate better random numbers
Mt_srand-play a better random number generator seed
Octdec-octal to decimal
Pi-obtain the circumference rate value
Pow-exponential expression
Rad2deg-converts radians to degrees.
Rand-generate a random integer
Round-rounding floating point numbers
Sin-sine
Sinh-hyperbolic sine
Sqrt-square root
Srand-broadcast the seed of the random number generator
Tan-tangent
Tanh-hyperbolic tangent

 

String functions:

Learn at least 20. Usually marked with red.

Addcslashes-escape characters in strings using backslash in the C-language style
Addslashes-use a backslash to reference a string
Bin2hex-Convert binary data to hexadecimal representation
Alias of chop-rtrim
Chr-return the specified character
Chunk_split-splits a string into small parts
Convert_cyr_string-converts a character from one Cyrillic to another.
Convert_uudecode-decodes a uencode string
Convert_uuencode-encode a string using uuencode
Count_chars-returns the characters used by the string.
Crc32-calculate the crc32 polynomial of a string
Crypt-unidirectional String hash
Echo-output one or more strings
Explode-use one string to separate another string
Fprintf-Write formatted strings to the stream
Get_html_translation_table-return the conversion table after using htmlspecialchars and htmlentities
Hebrev-convert the logical sequence Hebrew (logical-Hebrew) to the visual sequence Hebrew (visual-Hebrew)
Hebrevc-converts the logical sequence Hebrew (logical-Hebrew) to the visual sequence Hebrew (visual-Hebrew), and converts the line break
Html_entity_decode-Convert all HTML entities to their applicable characters
Htmlentities-Convert all applicable characters to HTML entities
Htmlspecialchars_decode-Convert special HTML entities back to characters
Htmlspecialchars-Convert special characters to HTML entities
Implode-Join array elements with a string
Join-alias implode
Lcfirst-Make a string's first character lowercase
Levenshtein-Calculate Levenshtein distance between two strings
Localeconv-Get numeric formatting information
Ltrim-Strip whitespace (or other characters) from the beginning of a string
Md5_file-calculate the MD5 hash value of the specified file
Md5-calculate the MD5 hash value of a string
Metaphone-Calculate the metaphone key of a string
Money_format-Formats a number as a currency string
Nl_langinfo-Query language and locale information
Nl2br-insert the HTML line feed mark before all new lines of the string
Number_format-Format a number with grouped thousands
Ord-returns the ASCII value of a character.
Parse_str-Parses the string into variables
Print-output string
Printf-output formatted string
Quoted_printable_decode-Convert a quoted-printable string to an 8-bit string
Quoted_printable_encode-Convert a 8 bit string to a quoted-printable string
Quotemeta-Quote meta characters
Rtrim-removes white spaces (or other characters) at the end of a string)
Setlocale-Set locale information
Sha1_file-calculate the sha1 hash value of the file
Sha1-calculate the sha1 hash value of the string
Similar_text-calculate the similarity between two strings
Soundex-Calculate the soundex key of a string
Sprintf-Return a formatted string
Sscanf-Parses input from a string according to a format
Str_getcsv-parses a CSV string as an array
Case-insensitive version of str_ireplace-str_replace
Str_pad-use another string to fill the string with the specified length
Str_repeat-repeat a string
Str_replace-substring replacement
Str_rot13-execute the ROT13 conversion on the string
Str_shuffle-randomly disconnects a string
Str_split-convert string to array
Str_word_count-returns the usage of words in the string
Strcasecmp-binary security comparison string (case insensitive)
Strchr-alias strstr
Strcmp-binary security string comparison
Strcoll-string comparison based on region settings
Strcspn-get the length of the starting substring of the unmatched mask
Strip_tags-remove HTML and PHP tags from strings
Stripcslashes-references a string escaped using addcslashes
Stripos-locate the first occurrence of a string (case insensitive)
Stripslashes-references a reference string
The stristr-strstr function is case-insensitive.
Strlen-get the string length
Strnatcasecmp-use the natural order algorithm to compare strings (case insensitive)
Strnatcmp-use a natural sorting algorithm to compare strings
Strncasecmp-several characters starting with a binary security comparison string (case insensitive)
Strncmp-several characters starting with a binary security comparison string
Strpbrk-find any character of a group of characters in a string
Strpos-locate the first occurrence of a string
Strrchr-find the last occurrence of a specified character in the string
Strrev-reverse string
Strripos-calculate the position of the last occurrence of the specified string in the target string (case insensitive)
Strrpos-calculate the position of the last occurrence of the specified string in the target string
Strsps-calculate the length of the first substring in a string that contains all characters in the specified character set.
Strstr-first appearance of the search string
Strtok-mark the delimiter
Strtolower-converts a string to lowercase
Strtoupper-converts a string to uppercase
Strtr-conversion of specified characters
Substr_compare-binary secure comparison string (compare the specified length from the offset position)
Substr_count-calculates the number of times a string appears.
Substr_replace-replace the substring of a string
Substr-returns the substring of the string.
Trim-removes spaces (or other characters) at the beginning and end of the string)
Ucfirst-converts the first letter of a string to uppercase
Ucwords-converts the first letter of each word in a string to uppercase
Vfprintf-Write formatted strings to the stream
Vprintf-output formatted string
Vsprintf-returns the formatted string
Wordwrap-the interrupt string is a specified number of strings.

 

Array functions

Learn at least 15 of them. Usually marked with red.

 

Array_change_key_case-returns an array of string keys in lowercase or uppercase.
Array_chunk-divide an array into multiple
Array_combine-creates an array and uses the value of one array as its key name, and the value of another array as its value
Array_count_values-count the number of occurrences of all values in the array
Array_diff_assoc-calculate the array's difference set with index check
Array_diff_key-use the key name to compare the difference set of the calculated array
Array_diff_uassoc-use the callback function provided by the user to perform an index check to calculate the array's difference set
Array_diff_ukey-use the callback function to compare the difference set of the calculated array with the key name
Array_diff-calculate the difference set of the array
Array_fill_keys-fill the array with the specified key and value
Array_fill-fill the array with the given value
Array_filter-filter elements in the array using the callback function
Array_flip-swap the keys and values in the array
Array_intersect_assoc-intersection of arrays computed by checking indexes
Array_intersect_key-use a key name to compare and calculate the intersection of arrays
Array_intersect_uassoc-returns the intersection of arrays computed by checking indexes and compares indexes with callback functions.
Array_intersect_ukey-use the callback function to compare key names to calculate the intersection of arrays
Array_intersect-calculates the intersection of arrays
Array_key_exists-check whether the given key name or index exists in the array
Array_keys-returns all the key names in the array.
Array_map-calls the callback function to the unit of the given array.
Array_merge_recursive-recursively merge one or more arrays
Array_merge-merge one or more arrays
Array_multisort-sorts multiple arrays or multi-dimensional arrays.
Array_pad-fill the array with a value to the specified length
Array_pop-bring up the last unit of the array (Out Stack)
Array_product-calculate the product of all values in the array
Array_push-push one or more units to the end of the array (into the stack)
Array_rand-randomly retrieve one or more units from the array
Array_reduce-use callback functions to iteratively simplify an array to a single value
Array_replace_recursive-recursively replaces the element of the first array with the passed array
Array_replace-replace the element of the first array with the passed array
Array_reverse-returns an array with the opposite unit order.
Array_search-search for a given value in the array. if the value is successful, the corresponding key name is returned.
Array_shift-removes elements starting with an array from the array
Array_slice-extract a segment from the array
Array_splice-removes a part of the array and replaces it with other values.
Array_sum-calculates the sum of all values in the array
Array_udiff_assoc-calculate the difference set of the array with index check and use the callback function to compare data
Array_udiff_uassoc-calculate the difference set of the array with index check, and use the callback function to compare data and indexes.
Array_udiff-use the callback function to compare data to calculate the difference set of the array
Array_uintersect_assoc-returns the intersection of arrays computed by checking indexes and compares data with callback functions.
Array_uintersect_uassoc-returns the intersection of arrays computed by checking indexes and compares data and indexes using callback functions.
Array_uintersect-calculate the intersection of arrays and use the callback function to compare data
Array_unique-Remove repeated values from the array
Array_unshift-insert one or more units at the beginning of the array
Array_values-returns all values in the array.
Array_walk_recursive-recursively applies user functions to each member in the array
Array_walk-apply user functions to each member in the array
Array-create an array
Arsort-sorts arrays in reverse order and maintains the index relationship.
Asort-sorts arrays and maintains the index relationship
Compact-create an array, including variable names and their values
Count-calculates the number of units in the array or the number of attributes in the object.
Current-returns the current cell in the array.
Each-returns the current key/value pair in the array and moves the array pointer one step forward.
End-points the internal pointer of the array to the last unit.
Extract-import the variable from the array to the current symbol table
In_array-check whether a value exists in the array
Key-get the key name from the associated array
Krsort-sort arrays in reverse order by key name
Ksort-sort the array by key name
List-assign values in the array to some variables
Natcasesort-use the "natural sorting" algorithm to sort arrays by case-insensitive letters
Natsort-sort arrays using the "natural sorting" algorithm
Next-move the internal pointer in the array to a forward position.
Alias of pos-current
Prev-returns the internal pointer of the array to one position.
Range-create an array containing the specified range units
Reset-point the internal pointer of the array to the first unit
Rsort-reverse sorting of arrays
Shuffle-disrupt the array
Alias of sizeof-count
Sort-sort arrays
Uasort-sort the values in the array using the user-defined comparison function and maintain the index Association
Uksort-sort the key names in the array using the user-defined comparison function
Usort-use a user-defined comparison function to sort the values in the array

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.