PHP Functions Reference
38 functions
isset()
Determines whether a variable is declared and is different than null.
empty()
Determines whether a variable is considered empty, returning true for falsy values and undefined variables.
is_array()
Finds whether a variable is an array, returning true for arrays and false for all other data types.
strlen()
Returns the length of a string in bytes, counting all characters including null bytes and multibyte sequences.
str_replace()
Replaces all occurrences of a search string with a replacement string in the given subject, returning a new modified string or array.
explode()
Splits a string into an array by breaking it apart using a specified delimiter or separator string.
implode()
Joins array elements into a single string using an optional separator between each element.
in_array()
Searches an array for a specific value and returns true if found, performing either loose or strict comparison based on the optional strict parameter.
trim()
Removes whitespace or specified characters from both the beginning and end of a string, returning a cleaned version without modifying the original.
json_encode()
Converts PHP variables into JSON-formatted strings, enabling seamless data exchange between PHP applications and systems that consume JSON.
json_decode()
Converts JSON-formatted strings into PHP variables, transforming structured data into native types for seamless application integration.
array_map()
Applies a callback function to each element of one or more arrays and returns a new array containing the transformed results.
array_filter()
Filters elements of an array using a callback function, returning a new array containing only elements that pass the specified test condition.
strtotime()
Parses English textual date and time descriptions into Unix timestamps, enabling flexible date manipulation and comparison operations.
date()
Formats a local date and time into a human-readable string using specified format characters and an optional timestamp.
var_dump()
Displays structured information about variables including data type, value, and recursive content for arrays and objects.
array_key_exists()
Checks whether a specific key or index exists in an array, returning true regardless of the associated value including null.
http_response_code()
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.
header()
Sends raw HTTP headers to the client browser, enabling control over response codes, content types, redirections, and cache behavior before any output transmission.
file_get_contents()
Reads entire file content into a string using memory mapping techniques when available, supporting both local files and remote URLs with customizable context options.
require_once()
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.
ucfirst()
Converts the first character of a string to uppercase if it's an ASCII lowercase letter, returning a new string with the modification applied.
htmlspecialchars()
Converts special characters to HTML entities to prevent XSS attacks and ensure proper HTML rendering of user-generated content.
password_hash()
Creates secure password hashes using modern cryptographic algorithms, automatically generating salts and encoding all necessary verification data within the returned hash string.
password_verify()
Verifies that a plain text password matches a cryptographic hash, using timing-attack-safe comparison algorithms for secure authentication.
array_slice()
Extracts a portion of an array and returns it as a new array, allowing precise control over starting position, length, and key preservation.
array_keys()
Returns all keys or a subset of keys from an array as a new array, optionally filtering by value matching.
array_values()
Returns all values from an array with sequential numeric keys, effectively reindexing the array while preserving value order.
substr()
Extracts a portion of a string starting from a specified position with optional length control, returning the requested substring as a new string.
is_null()
Checks whether a variable is null, returning true for null values and undefined variables while generating notices for uninitialized variables.
max()
Finds and returns the highest value from multiple parameters or a single array, using PHP's standard comparison rules for different data types.
min()
Finds and returns the lowest value from multiple parameters or a single array, using PHP's standard comparison rules for different data types.
round()
Rounds a floating-point number to specified precision using configurable rounding modes for precise numerical control.
time()
Returns the current Unix timestamp representing seconds elapsed since January 1, 1970 00:00:00 GMT.
file_exists()
Determines whether a file or directory exists at the specified path location.
fopen()
Opens a file or URL and returns a file pointer resource that can be used for reading, writing, or appending operations.
fwrite()
Writes string data to an open file resource and returns the number of bytes successfully written.