PHP function accumulation summary_PHP tutorial
Math function:
10 of the more commonly used ones are marked red.
abs — absolute value
acos — inverse cosine
acosh — inverse hyperbolic cosine
asin — arcsine
asinh — inverse hyperbolic sine
atan2 — arctangent of two parameters
atan — arctangent
atanh — inverse hyperbolic tangent
base_convert — Convert numbers between arbitrary bases
bindec — Convert binary to decimal
ceil — round to the next nearest whole
cos — cosine
cosh — hyperbolic cosine
decbin — Convert decimal to binary
dechex — Convert decimal to hexadecimal
decoct — Convert decimal to octal
deg2rad — Convert angles to radians
exp — Compute the exponent of e
expm1 — Returns exp(number) - 1, which can be calculated accurately even when number is close to zero
floor — Rounding by rounding
fmod — Returns the floating point remainder of division
getrandmax — displays the largest possible value of a random number
hexdec — Convert hexadecimal to decimal
hypot — Calculate the length of the hypotenuse of a right triangle
is_finite — Determine whether it is a finite value
is_infinite — Determine whether the value is infinite
is_nan — Determine whether it is a legal value
lcg_value — Combinatorial linear congruential generator
log10 — Logarithm to base 10
log1p — Returns log(1 + number), which can be calculated accurately even when the value of number is close to zero
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 — Sow a better random number generator
octdec — Convert octal to decimal
pi — get the value of pi
pow — exponential expression
rad2deg — Convert radians to corresponding degrees
rand — Generate a random integer
round — Round floating point numbers
sin — sine
sinh — hyperbolic sine
sqrt — square root
srand — Seed a random number generator
tan — tangent
tanh — hyperbolic tangent
String functions:
The more the merrier, at least master 20. More commonly marked red.
addcslashes — Escape characters in a string using backslashes in C style
addslashes — Use backslashes to quote strings
bin2hex — Convert binary data to hexadecimal representation
chop — alias for rtrim
chr — Returns the specified character
chunk_split — Split a string into small chunks
convert_cyr_string — Convert a character from one Cyrillic character to another
convert_uudecode — Decode a uuencode-encoded string
convert_uuencode — Encode a string using uuencode
count_chars — Returns information about the characters used in a string
crc32 — Compute the crc32 polynomial of a string
crypt — One-way string hashing
echo — Output one or more strings
explode — Split one string into another
fprintf — Write a formatted string to a stream
get_html_translation_table — Returns the translation table using htmlspecialchars and htmlentities
hebrev — Convert logical-Hebrew to visual-Hebrew
hebrevc — Convert logical-Hebrew to visual-Hebrew, converting newlines
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 — Computes the MD5 hash 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 an HTML line break
before all new lines in a string
number_format — Format a number with grouped thousands
ord — Returns the ASCII code value of the 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 — Remove whitespace characters (or other characters) from the end of a string
setlocale — Set locale information
sha1_file — Compute the sha1 hash of a file
sha1 — Compute the sha1 hash value of a 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 — Parse a CSV string into an array
str_ireplace — Case-ignoring version of str_replace
str_pad — Pad a string to a specified length with another string
str_repeat — Repeat a string
str_replace — Substring replacement
str_rot13 — performs a ROT13 conversion on a string
str_shuffle — randomly shuffle a string
str_split — Convert a string to an array
str_word_count — Returns the usage of words in a string
strcasecmp — Binary safe comparison of strings (case insensitive)
strchr — alias strstr
strcmp — Binary safe string comparison
strcoll — Locale-based string comparison
strcspn — Get the length of the starting substring of the non-matching mask
strip_tags — Strip HTML and PHP tags from strings
stripcslashes — dequote a string escaped using addcslashes
stripos — Find the first occurrence of a string (case insensitive)
stripslashes — backquote a quoted string
stristr — A case-ignoring version of the strstr function
strlen — Get the length of a string
strnatcasecmp — Compare strings using the "natural order" algorithm (case-insensitive)
strnatcmp — Compare strings using natural ordering algorithm
strncasecmp — Binary safe comparison of several characters at the beginning of a string (case insensitive)
strncmp — Binary safe comparison of several characters at the beginning of a string
strpbrk — Find any character in a set of characters in a string
strpos — Find the first occurrence of a string
strrchr — Find the last occurrence of a specified character in a string
strrev — Reverse a 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
strspn — Calculates the length of the first substring of a string in which all characters are present in the specified character set.
strstr — Find the first occurrence of a string
strtok — token split string
strtolower — Convert a string to lowercase
strtoupper — Convert a string to uppercase
strtr — Convert the specified character
substr_compare — Binary safe comparison of strings (specified length compared from offset position)
substr_count — Count the number of occurrences of a string
substr_replace — Replace a substring of a string
substr — Returns a substring of a string
trim — remove whitespace characters (or other characters) at the beginning and end of a string
ucfirst — Convert the first letter of a string to uppercase
ucwords — Convert the first letter of each word in a string to uppercase
vfprintf — Write a formatted string to a stream
vprintf — Output formatted string
vsprintf — Returns a formatted string
wordwrap — breaks a string into a specified number of words
Array function
The more the merrier, at least master 15. More commonly marked red.
array_change_key_case — Returns an array whose string keys are all lowercase or uppercase
array_chunk — Split an array into multiple
array_combine — Create an array with values from one array as keys and values from another array
array_count_values — Count the number of occurrences of all values in an array
array_diff_assoc — Compute the difference of an array with index checking
array_diff_key — Compute the difference of an array using key name comparison
array_diff_uassoc — Compute the difference of an array using a user-supplied callback function with index checking
array_diff_ukey — Use callback function to compare key names to calculate the difference of array
array_diff — Calculate the difference of arrays
array_fill_keys — Fill an array with specified keys and values
array_fill — Fill an array
with the given values
array_filter — Filter elements in an array using a callback function
array_flip — swap keys and values in an array
array_intersect_assoc — Compute the intersection of arrays with index checking
array_intersect_key — Compute the intersection of arrays using key comparison
array_intersect_uassoc — Compute the intersection of arrays with index checking, using a callback function to compare the indices
array_intersect_ukey — Compute the intersection of arrays using callback functions to compare keys
array_intersect — Compute the intersection of arrays
array_key_exists — Check if a given key or index exists in an array
array_keys — Returns all key names in the array
array_map — apply a callback function to the cells of the given array
array_merge_recursive — Merge one or more arrays recursively
array_merge — Merge one or more arrays
array_multisort — Sort multiple arrays or multidimensional arrays
array_pad — Pad an array to a specified length with values
array_pop — pop the last element of the array
array_product — Calculates the product of all values in an array
array_push — Push one or more elements to the end of an array (push)
array_rand — Randomly remove one or more elements from an array
array_reduce — Iteratively reduce an array to a single value using a callback function
array_replace_recursive — Recursively replace elements of the first array with the passed array
array_replace — Replace elements of the first array with the passed array
array_reverse — Returns an array with the cells in reverse order
array_search — Search for a given value in an array, returning the corresponding key if successful
array_shift — Shift the elements at the beginning of the array out of the array
array_slice — Remove a segment
from an array
array_splice — Remove part of an array and replace it with another value
array_sum — Calculates the sum of all values in an array
array_udiff_assoc — Computes the difference of arrays with index checking, using callback functions to compare data
array_udiff_uassoc — Calculate the difference of an array with index checking, using a callback function to compare the data and index
array_udiff — Use callback functions to compare data to calculate the difference of arrays
array_uintersect_assoc — Compute the intersection of arrays with index checking and compare data using callback functions
array_uintersect_uassoc — Compute the intersection of arrays with index checking, using a callback function to compare data and index
array_uintersect — Calculate the intersection of arrays and use callback functions to compare data
array_unique — Remove duplicate values from an array
array_unshift — Insert one or more cells at the beginning of an array
array_values — Returns all values in an array
array_walk_recursive — Recursively apply a user function to each member of an array
array_walk — Apply a user function to each member of an array
array — Create a new array
arsort — Sort an array in reverse order while maintaining index relationships
asort — Sort an array while maintaining index relationships
compact — Create an array including variable names and their values
count — Count the number of cells in an array or the number of attributes in an object
current — Returns the current element in the array
each — Returns the current key/value pair in the array and moves the array pointer forward one step
end — Set the internal pointer of the array to the last element
extract — Import variables from an array into the current symbol table
in_array — Check if a value exists in an array
key — Get the key name from an associative array
krsort — Sort an array in reverse order by key
ksort — Sort an array by key
list — Assign the values in an array to some variables
natcasesort — Case-insensitive sorting of an array using the "natural sort" algorithm
natsort — Sort an array using the "natural sorting" algorithm
next — Move the internal pointer in the array forward one position
pos — alias for current
prev — rewind the array’s internal pointer one bit
range — Create an array containing cells in the specified range
reset — Set the array’s internal pointer to the first element
rsort — Sort an array in reverse order
shuffle — shuffle an array
sizeof — alias for count
sort — Sort an array
uasort — Sort values in an array using a user-defined comparison function and maintain index association
uksort — Sort keys in an array using a user-defined comparison function
usort — Sort values in an array using a user-defined comparison function

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.
