PHP Functions Reference
50 functions • Fast search & favorites
array_merge
ArrayMerges the elements of one or more arrays together so that the values of one are appended to the end of the previous one.
Parameters
strlen
StringReturns the length of a string in bytes.
Parameters
substr
StringReturns a portion of a string specified by start and length parameters.
Parameters
explode
StringSplits a string by a delimiter and returns an array of strings.
Parameters
str_replace
StringReplaces all occurrences of search string with replacement string.
Parameters
is_array
VariableChecks whether a variable is an array.
Parameters
trim
StringReturns a string with whitespace (or other characters) stripped from the beginning and end of string.
Parameters
count
ArrayCounts all elements in an array or properties in an object that implements Countable.
Parameters
in_array
ArrayChecks if a value exists in an array.
Parameters
implode
StringJoins array elements with a string separator.
Parameters
file_get_contents
File SystemReads entire file into a string. This is the preferred way to read the contents of a file into a string.
Parameters
json_encode
JSONReturns the JSON representation of a value. Used for serializing PHP data structures to JSON format.
Parameters
isset
VariableDetermines if a variable is declared and is different than null.
Parameters
unset
VariableDestroys the specified variables. Unset removes the variable from memory.
Parameters
empty
VariableDetermines whether a variable is empty. A variable is considered empty if it does not exist or if its value equals false.
Parameters
preg_match
RegExPerforms a regular expression match against a string and returns whether a match was found.
Parameters
date
Date/TimeFormats a local date and time according to the specified format string.
Parameters
array_push
ArrayPushes one or more elements onto the end of an array and returns the new number of elements.
Parameters
mysqli_query
DatabasePerforms a query against a MySQL database and returns a result set or boolean value.
Parameters
password_hash
SecurityCreates a password hash using a strong one-way hashing algorithm for secure password storage.
Parameters
htmlspecialchars
SecurityConverts special characters to HTML entities to prevent XSS attacks and ensure safe HTML output.
Parameters
strtolower
StringConverts all alphabetic characters in a string to lowercase.
Parameters
array_filter
ArrayFilters elements of an array using a callback function, returning only elements that pass the test.
Parameters
uniqid
MiscGenerates a unique identifier based on the current time in microseconds.
Parameters
round
MathRounds a float to the specified number of decimal places using specified rounding mode.
Parameters
array_map
ArrayApplies a callback function to the elements of one or more arrays and returns a new array with the results.
Parameters
array_column
ArrayReturns the values from a single column in a multi-dimensional array or array of objects.
Parameters
pathinfo
File SystemReturns information about a file path including directory, basename, extension, and filename.
Parameters
strpos
StringFinds the position of the first occurrence of a substring within a string.
Parameters
filter_var
ValidationFilters a variable with a specified filter, used for validating and sanitizing data.
Parameters
array_sum
ArrayCalculates and returns the sum of all values in an array as an integer or float.
Parameters
number_format
StringFormats a number with grouped thousands and customizable decimal/thousand separators.
Parameters
array_keys
ArrayReturns all keys or a subset of keys from an array, optionally filtered by value.
Parameters
array_values
ArrayReturns all values from an array with numeric keys, effectively reindexing the array.
Parameters
json_decode
JSONDecodes a JSON string into a PHP variable (object or array).
Parameters
array_slice
ArrayExtracts a slice of an array based on offset and length parameters without modifying the original array.
Parameters
time
Date/TimeReturns the current Unix timestamp (number of seconds since January 1, 1970 00:00:00 GMT).
Parameters
array_unique
ArrayRemoves duplicate values from an array and returns the array with unique values only.
Parameters
usort
ArraySorts an array by values using a user-defined comparison function, losing original keys.
Parameters
microtime
Date/TimeReturns the current Unix timestamp with microseconds for high-precision timing measurements.
Parameters
array_diff
ArrayCompares two or more arrays and returns the values from the first array that are not present in any of the other arrays.
Parameters
file_put_contents
File SystemWrites data to a file. This is the preferred way to write data to a file as it handles opening, writing, and closing automatically.
Parameters
strtr
StringTranslates characters or replaces substrings in a string using either character mapping or replacement pairs.
Parameters
parse_url
URLParses a URL and returns its components as an associative array or a specific component as a string.
Parameters
array_chunk
ArraySplits an array into chunks of specified size, returning a multidimensional indexed array with each chunk containing the specified number of elements.
Parameters
array_search
ArraySearches an array for a specific value and returns the corresponding key if found, or false if not found.
Parameters
preg_replace
RegExPerforms a regular expression search and replace operation on a string or array of strings.
Parameters
rand
MathGenerates a pseudo-random integer within a specified range or between 0 and getrandmax().
Parameters
max
MathReturns the highest value among the given values, or the highest value in an array.
Parameters
min
MathReturns the lowest value among the given values, or the lowest value in an array.