PHP Functions Reference

38 functions

All
isset()
PHP 4.0

Determines whether a variable is declared and is different than null.

variablevalidationnull
Variable
empty()
PHP 4.0

Determines whether a variable is considered empty, returning true for falsy values and undefined variables.

variablevalidationempty
Variable
is_array()
PHP 4.0

Finds whether a variable is an array, returning true for arrays and false for all other data types.

variabletypevalidation
Variable
strlen()
PHP 4.0

Returns the length of a string in bytes, counting all characters including null bytes and multibyte sequences.

stringlengthbytes
String
str_replace()
PHP 4.0

Replaces all occurrences of a search string with a replacement string in the given subject, returning a new modified string or array.

stringreplacesearch
String
explode()
PHP 4.0

Splits a string into an array by breaking it apart using a specified delimiter or separator string.

stringsplitdelimiter
String
implode()
PHP 4.0

Joins array elements into a single string using an optional separator between each element.

stringarrayjoin
String
in_array()
PHP 4.0

Searches an array for a specific value and returns true if found, performing either loose or strict comparison based on the optional strict parameter.

arraysearchvalidation
Array
trim()
PHP 4.0

Removes whitespace or specified characters from both the beginning and end of a string, returning a cleaned version without modifying the original.

stringwhitespacesanitization
String
json_encode()
PHP 5.2.0

Converts PHP variables into JSON-formatted strings, enabling seamless data exchange between PHP applications and systems that consume JSON.

jsonencodeapi
String
json_decode()
PHP 5.2.0

Converts JSON-formatted strings into PHP variables, transforming structured data into native types for seamless application integration.

jsondecodeparse
String
array_map()
PHP 4.0

Applies a callback function to each element of one or more arrays and returns a new array containing the transformed results.

arraymaptransform
Array
array_filter()
PHP 4.0.6

Filters elements of an array using a callback function, returning a new array containing only elements that pass the specified test condition.

arrayfiltercallback
Array
strtotime()
PHP 4.0

Parses English textual date and time descriptions into Unix timestamps, enabling flexible date manipulation and comparison operations.

datetimeparse
Date
date()
PHP 4.0

Formats a local date and time into a human-readable string using specified format characters and an optional timestamp.

datetimeformat
Date
var_dump()
PHP 4.0

Displays structured information about variables including data type, value, and recursive content for arrays and objects.

debugvariabledump
Variable
array_key_exists()
PHP 4.0.7

Checks whether a specific key or index exists in an array, returning true regardless of the associated value including null.

arraykeyexists
Array
http_response_code()
PHP 5.4.0

Gets or sets the HTTP response status code for the current request, providing a convenient way to control server response codes without manually crafting headers.

httpresponsestatus
Network
header()
PHP 4.0

Sends raw HTTP headers to the client browser, enabling control over response codes, content types, redirections, and cache behavior before any output transmission.

httpheadersresponse
Network
file_get_contents()
PHP 4.3.0

Reads entire file content into a string using memory mapping techniques when available, supporting both local files and remote URLs with customizable context options.

filereadcontent
File
require_once()
PHP 4.0

Includes and evaluates a file exactly once during script execution, preventing duplicate inclusions while ensuring fatal errors halt execution if the file cannot be found.

fileincluderequire
File
ucfirst()
PHP 4.0

Converts the first character of a string to uppercase if it's an ASCII lowercase letter, returning a new string with the modification applied.

stringuppercasecapitalization
String
htmlspecialchars()
PHP 4.0

Converts special characters to HTML entities to prevent XSS attacks and ensure proper HTML rendering of user-generated content.

htmlentitiesxss
String
password_hash()
PHP 5.5.0

Creates secure password hashes using modern cryptographic algorithms, automatically generating salts and encoding all necessary verification data within the returned hash string.

securitypasswordhash
Security
password_verify()
PHP 5.5.0

Verifies that a plain text password matches a cryptographic hash, using timing-attack-safe comparison algorithms for secure authentication.

passwordverifyauthentication
Security
array_slice()
PHP 4.0

Extracts a portion of an array and returns it as a new array, allowing precise control over starting position, length, and key preservation.

arraysliceextract
Array
array_keys()
PHP 4.0

Returns all keys or a subset of keys from an array as a new array, optionally filtering by value matching.

arraykeysextract
Array
array_values()
PHP 4.0

Returns all values from an array with sequential numeric keys, effectively reindexing the array while preserving value order.

arrayvaluesreindex
Array
substr()
PHP 4.0

Extracts a portion of a string starting from a specified position with optional length control, returning the requested substring as a new string.

stringsubstringextract
String
is_null()
PHP 4.0

Checks whether a variable is null, returning true for null values and undefined variables while generating notices for uninitialized variables.

variablenullvalidation
Variable
max()
PHP 4.0

Finds and returns the highest value from multiple parameters or a single array, using PHP's standard comparison rules for different data types.

comparisonmaximumhighest
Variable
min()
PHP 4.0

Finds and returns the lowest value from multiple parameters or a single array, using PHP's standard comparison rules for different data types.

minimumlowestcompare
Variable
round()
PHP 4.0

Rounds a floating-point number to specified precision using configurable rounding modes for precise numerical control.

mathroundingprecision
Math
time()
PHP 4.0.0

Returns the current Unix timestamp representing seconds elapsed since January 1, 1970 00:00:00 GMT.

timestampunixepoch
Date
file_exists()
PHP 4.0.0

Determines whether a file or directory exists at the specified path location.

fileexistsvalidation
Filesystem
fopen()
PHP 4.0

Opens a file or URL and returns a file pointer resource that can be used for reading, writing, or appending operations.

fileopenstream
File
fwrite()
PHP 4.0

Writes string data to an open file resource and returns the number of bytes successfully written.

writefilebinary
File
fclose()
PHP 4.0

Closes an open file pointer and releases the associated system resources, returning true on successful closure or false on failure.

filecloseresource
File