String Related Operation Functions

Removing Spaces or Other Characters

trim Removes spaces or other predefined characters from the both ends of a string
rtrim Removes spaces or other predefined characters from the right side of a string
chop Alias for rtrim(). Note that chop() differs from Perl's chop() function, as it removes the last character of the string.
ltrim Removes spaces or other predefined characters from the left side of a string

String Generation and Transformation

str_pad Pad a string to a specified length with another string
str_split Convert a string into an array
strrev Reverse a string
wordwrap Break a string into a specified number of chunks of words
str_shuffle Shuffle a string
parse_str Parse a string into variables
number_format Format a number with thousand separators

String Case Conversion

strtolower Convert a string to lowercase
strtoupper Convert a string to uppercase
ucfirst Make the first character of a string uppercase
lcfirst Make the first character of a string lowercase
ucwords Convert the first character of each word in a string to uppercase

HTML Tag Association

htmlentities Convert characters to HTML entities
htmlspecialchars Convert special characters to HTML entities
nl2br Insert HTML line breaks before all newlines in a string
strip_tags Strip HTML and PHP tags from a string
addcslashes Escape characters in a string with C-style escape sequences
stripcslashes Un-escape a string escaped with addcslashes()
addslashes Quote a string with slashes
stripslashes Strip slashes from a string
quotemeta Quote meta characters in a string
chr Return a character from a specified ASCII value
ord Return the ASCII value of the first character of a string

String Comparison

strcasecmp Case-insensitive comparison of two strings
strcmp Case-sensitive comparison of two strings
strncmp Compare the first N characters of the strings, case-sensitive
strncasecmp Compare the first N characters of the strings, case-insensitive
strnatcmp Compare strings in natural order, case-sensitive
strnatcasecmp Compare strings in natural order, case-insensitive

String Search and Replacement

str_replace String replacement operation, case-sensitive
str_ireplace String replacement operation, case-insensitive
substr_count Count the number of occurrences of a substring in a string
substr_replace Replace a substring within a string with another substring
similar_text Return the number of identical characters in two strings
strrchr Return the substring from the last occurrence of a character to the end of a string
strstr Return the substring from the beginning to the end of the first occurrence of a substring
strchr Alias for strstr, return the substring from the first occurrence of a character to the end of a string
stristr Return the substring from the beginning to the end of the first occurrence of a substring, case-insensitive
strtr Translate certain characters in a string
strpos Find the position of the first occurrence of a substring within a string
stripos Find the position of the first occurrence of a substring within a string, case-insensitive
strrpos Find the position of the last occurrence of a substring within a string
strripos Find the position of the last occurrence of a substring within a string, case-insensitive
strspn Return the length of the substring which consists of characters contained in the mask
strcspn Return the length of the substring which does not contain any characters contained in the mask

String Counting

str_word_count Count the number of words in a string
strlen Count the length of a string
count_chars Count the occurrences of all letters in a string (..255)

String Encoding

md5 Calculate the MD5 hash value of a string
hash Generate a hash code

Array Related Functions

Create Arrays

array Generate an array
array_combine Generate an array using the values of one array as keys and the values of another array as values
range Create and return an array containing elements of a specified range
compact Create an array composed of variables brought by parameters
array_fill Fill and generate an array with a given value

Array Merging and Splitting

array_chunk Split an array into new array chunks
array_merge Merge two or more arrays into one array
array_slice Extract a segment of values from an array based on conditions and return it.

Array Comparison

array_diff Return the difference array of two arrays
array_intersect Return the intersection array of two or more arrays

Array Search and Replacement

array_splice Remove a part of the array and replace it with other values
array_sum Return the sum of all values in the array
in_array Search for a specified value in an array, case-sensitive
array_key_exists Determine whether a specified key exists in an array

Array Pointer Operations

key Returns the key at the current position of the internal pointer of an array
current Returns the element at the current position of an array
next Advances the internal pointer of an array to the next element and returns the value of the current element
prev Rewind the internal pointer of an array to the previous element and returns the value of the current element
end Advances the internal pointer to the last element of an array and returns its value(if successful)
reset Sets the array's internal pointer to the first element and returns its value
list Assigns variables in a group with the values of an array
array_shift Removes the first element from an array and returns the removed value
array_unshift Inserts one or more elements at the beginning of an array
array_push Appends one or more elements to the end of an array
array_pop Removes the last element from an array

Array Key and Value Operations

shuffle Randomly shuffles the elements of an array, preserving key association
count Counts the number of elements in an array or properties in an object
array_flip Returns an array with keys and values flipped
array_keys Returns all the keys of an array as an array
array_values Returns all the values of an array as an array
array_reverse Returns an array with the order of the elements reversed
array_count_values Counts all the values of an array
array_rand Picks one or more random keys out of an array
each Returns the current key and value pair from an array and advances the array cursor
array_unique Removes duplicate values from an array

Array Sorting

sort Sorts an array
rsort Sorts an array in reverse order
asort Sorts an array and maintains index association
arsort Sorts an array in reverse order and maintains index association
ksort Sorts an array by key
krsort Sorts an array by key in reverse order
natsort Sorts an array using a "natural order" algorithm
natcasesort Sorts an array using a case-insensitive "natural order" algorithm

Mathematical Functions

abs Calculates the absolute value of a number
ceil Rounds a number up to the next largest integer
floor Rounds a number down to the next smallest integer
fmod Return the floating-point remainder of the division
pow Return the Nth power of a number
round Floating-point rounding method
sqrt Calculate the square root
max Find the maximum value
min Find the minimum value
mt_rand Better random number
rand Random number
pi Obtain the value of pi
octdec Convert octal to decimal

MySQL related functions

mysql_affected_rows Get the number of rows affected by the last MySQL operation
mysql_client_encoding Return the name of the character set
mysql_close Close the MySQL connection
mysql_connect Open a connection to the MySQL server
mysql_create_db Create a new MySQL database
mysql_data_seek Move the internal result pointer
mysql_db_name Get the result data
mysql_db_query Send a MySQL query
mysql_drop_db Discard (delete) a MySQL database
mysql_errno Return the numeric code of the error message from the last MySQL operation
mysql_error Return the text error message generated by the last MySQL operation
mysql_escape_string Escape a string for mysql_query
mysql_fetch_array Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc Fetch a result row as an associative array
mysql_fetch_field Get column information from the result and return as an object
mysql_fetch_lengths Get the lengths of each output in the result set
mysql_fetch_object Fetch a result row as an object
mysql_fetch_row Fetch a result row as a numeric array
mysql_field_flags Retrieve the flags associated with a specified field in the result set
mysql_field_len Returns the length of a specified field
mysql_field_name Obtain the field name of a specified field in the result set
mysql_field_seek Set the result set pointer to a specified field offset
mysql_field_table Obtain the table name where the specified field is located
mysql_field_type Obtain the type of a specified field in the result set
mysql_free_result Free the result memory
mysql_get_client_info Retrieve MySQL client information
mysql_get_host_info Retrieve MySQL host information
mysql_get_proto_info Retrieve MySQL protocol information
mysql_get_server_info Retrieve MySQL server information
mysql_info Retrieve information about the most recent query
mysql_insert_id Retrieve the ID generated by the last INSERT operation
mysql_list_dbs List all databases on the MySQL server
mysql_list_fields List the fields in the MySQL result
mysql_list_processes List MySQL processes
mysql_list_tables List the tables in the MySQL database
mysql_num_fields Obtain the number of fields in the result set
mysql_num_rows Obtain the number of rows in the result set
mysql_pconnect Open a persistent connection to the MySQL server
mysql_ping Ping a server connection, and reconnect if there is no connection
mysql_query Send a MySQL query
mysql_real_escape_string Escape special characters in strings used in SQL statements, considering the current character set of the connection
mysql_result Retrieve result data
mysql_select_db Select a MySQL database
mysql_set_charset Set the client character set
mysql_stat Retrieve the current system status
mysql_tablename Get table name
mysql_thread_id Returns the ID of the current thread
mysql_unbuffered_query Sends an SQL query to MySQL without fetching and caching the result rows

File directory processing related functions

basename Returns the filename part of the path
chgrp Changes the group ownership of a file
chmod Changes the file mode
chown Changes the owner of a file
clearstatcache Clears the file status cache
copy Copies a file
delete See unlink or unset
dirname Returns the directory part of the path
disk_free_space Returns the free space in the directory
disk_total_space Returns the total disk space of a directory
diskfreespace An alias of disk_free_space
fclose Closes an open file pointer
feof Tests whether the file pointer has reached the end of the file
fflush Flushes the output to a file
fgetc Reads a character from a file pointer
fgetcsv Reads a line from a file pointer and parses CSV fields
fgets Reads a line from a file pointer
fgetss Reads a line from a file pointer and strips HTML tags
file_exists Checks whether a file or directory exists
file_get_contents Reads the entire file into a string
file_put_contents Writes a string into a file
file Reads the entire file into an array
fileatime Gets the last access time of a file
filectime Gets the inode modification time of a file
filegroup Gets the group of a file
fileinode Gets the inode of a file
filemtime Gets the modification time of a file
fileowner Gets the owner of a file
fileperms Gets the permissions of a file
filesize Gets the size of a file
filetype Gets the type of a file
flock Portable advisory file locking
fnmatch Matches a file name against a pattern
fopen Opens a file or URL
fpassthru Outputs all remaining data from a file pointer
fputcsv Formats a line as CSV and writes it into a file pointer
fputs An alias of fwrite
fread Reads a file (safe for use with binary files)
fscanf Parses input from a file
fseek Set the file position indicator for the file referenced by stream
fstat Gather file status information about the file associated with the open file pointer
ftell Get current position of file pointer
ftruncate Truncate file to a given length
fwrite Write data to a file
glob Find pathnames matching a pattern
is_dir Check if the filename is a directory
is_executable Check if the file is executable
is_file Check if the file is a regular file
is_readable Check if the file is readable
is_uploaded_file Check if file was uploaded via HTTP POST
is_writable Check if the file is writable
is_writeable Alias of is_writable
lchgrp Changes group ownership of symlink
lchown Changes user ownership of symlink
linkinfo Get information about a link
lstat Give information about a file or symbolic link
md5_file Calculate the MD5 hash of a given file
mkdir Create a directory
move_uploaded_file Move an uploaded file to a new location
parse_ini_file Parse a configuration file
parse_ini_string Parse a configuration string
pathinfo Return information about a file path
pclose Close a file pointer opened by popen
popen Open a process file pointer
readfile Output a file
realpath_cache_get Get realpath cache entries
realpath_cache_size Get realpath cache size
realpath Return the resolved path
rename Rename a file or directory
rewind Rewind the position of a file pointer
rmdir Remove a directory
set_file_buffer Alias of stream_set_write_buffer
stat Gather file status information
tempnam Create file with unique file name
tmpfile Create a temporary file
touch Set access and modification time of file
umask Change the current umask

GD/Image Functions

gd_info Get information about the currently installed GD library
getimagesize Get the size of an image
getimagesizefromstring Get the size of an image from a string
image_type_to_extension Get the file extension of image types
image_type_to_mime_type Get the MIME type for image types
image2wbmp Output an image to browser or file in WBMP format
imagealphablending Set the blending mode for an image
imageantialias Whether to use antialiasing functions
imagearc Draw an elliptical arc
imagechar Draw a character horizontally
imagecharup Draw a character vertically
imagecolorallocate Allocate a color for an image
imagecolorallocatealpha Allocate a color with alpha for an image
imagecolorat Get the color index at a pixel
imagecolorclosest Get the index of the closest color to the specified one
imagecolorclosestalpha Get the closest color with transparency to the specified one
imagecolorclosesthwb Get the index of the closest color in hue, white and black to the given color
imagecolordeallocate Deallocate the color of an image
imagecolorexact Get the index of the specified color
imagecolorexactalpha Get the index of the specified color with transparency
imagecolormatch Make the colors in a palette version of an image match the true color version better
imagecolorresolve Get the index of the specified color or the closest possible alternative
imagecolorresolvealpha Get the index of the specified color with alpha or the closest possible alternative
imagecolorset Set the color for a specified palette index
imagecolorsforindex Get the colors for a specific index
imagecolorstotal Get the total number of colors in an image's palette
imagecolortransparent Define a color as transparent
imageconvolution Apply a 3x3 convolution matrix with coefficients div and offset
imagecopy Copy a part of an image
imagecopymerge Copy and merge a part of an image
imagecopymergegray Copy and merge a part of an image in grayscale
imagecopyresampled Copy and resample a part of an image to adjust its size
imagecopyresized Copy a part of an image and resize it
imagecreate Create a palette-based image
imagecreatefromgd2 Create an image from a GD2 file or URL
imagecreatefromgd2part Create an image from a part of a given GD2 file or URL
imagecreatefromgd Create an image from a GD file or URL
imagecreatefromgif Create a new image from a file or URL
imagecreatefromjpeg Create a new image from a file or URL
imagecreatefrompng Create a new image from a file or URL
imagecreatefromstring Create an image from an image stream in a string
imagecreatefromwbmp Create a new image from a file or URL
imagecreatefromxbm Create a new image from a file or URL
imagecreatefromxpm Create a new image from a file or URL
imagecreatetruecolor Create a true color image
imagedashedline Draw a dashed line
imagedestroy Destroy an image
imageellipse Draw an ellipse
imagefill Fill an area
imagefilledarc Draw and fill an elliptical arc
imagefilledellipse Draw and fill an ellipse
imagefilledpolygon Draw and fill a polygon
imagefilledrectangle Draw and fill a rectangle
imagefilltoborder Fill an area up to the boundary of a specified color
imagefilter Apply a filter to an image
imagefontheight Get the font height
imagefontwidth Get the font width
imageftbbox Give a text box using a FreeType 2 font
imagefttext Write text into an image using a FreeType 2 font
imagegammacorrect Apply gamma correction to a GD image
imagegd2 Output a GD2 image to the browser or a file
imagegd Output a GD image to the browser or a file
imagegif Output image to browser or file
imagegrabscreen Captures the whole screen
imagegrabwindow Captures a window
imageinterlace Activate or disable interlacing
imageistruecolor Check if the image is truecolor
imagejpeg Output image to browser or file
imagelayereffect Set the alpha blending flag to use the bound libgd layer effect
imageline Draw a line segment
imageloadfont Load a new font
imagepalettecopy Copy the palette from one image to another
imagepng Output image in PNG format to browser or file
imagepolygon Draw a polygon
imagepsbbox Provide a bounding box for text using PostScript Type1 font
imagepsencodefont Change the character encoding vector in the font
imagepsextendfont Expand or condense the font
imagepsfreefont Release the memory occupied by a PostScript Type 1 font
imagepsloadfont Load a PostScript Type 1 font from a file
imagepsslantfont Slant a font
imagepstext Draw a text string on the image using PostScript Type1 font
imagerectangle Draw a rectangle
imagerotate Rotate an image with a given angle
imagesavealpha Set the flag to save the full alpha channel information when saving PNG images (opposite to a single transparent color)
imagesetbrush Set the brush image used for drawing lines
imagesetpixel Draw a single pixel
imagesetstyle Set the style of drawing lines
imagesetthickness Set the width of drawing lines
imagesettile Set the tile used for filling
imagestring Draw a horizontal string
imagestringup Draw a vertical string
imagesx Get the width of the image
imagesy Get the height of the image
imagetruecolortopalette Convert a truecolor image to a palette image
imagettfbbox Get the range of text using TrueType font
imagettftext Write text to an image using TrueType font
imagetypes Return the image types supported by the current PHP version
imagewbmp Output image in WBMP format to browser or file
imagexbm Output XBM image to browser or file
iptcembed Embed binary IPTC data into a JPEG image
iptcparse Parse binary IPTC http://www.iptc.org/ blocks into individual tags
jpeg2wbmp Convert JPEG image file to WBMP image file
png2wbmp Convert PNG image file to WBMP image file

session functions

session_cache_expire Return the current cache expiration
session_cache_limiter Get and set the current cache limiter
session_commit Alias of session_write_close
session_decode Decode session data from a session encoded string
session_destroy Destroy all data registered to the session
session_encode Encode the current session data into a string
session_id Get and/or set the current session ID
session_is_registered Check if a variable is registered in the session
session_module_name Get and/or set the current session module
session_name Get and/or set the current session name
session_regenerate_id Update the session ID generated by a new generation
session_register_shutdown Session shutdown function
session_register Register one or more global variables with the current session
session_save_path Get and/or set the current session save path
session_set_save_handler Set user-level session storage functions
session_start Start a new or resume an existing session
session_status Return the current session status
session_unregister Unregister a global variable from the current session
session_unset Free all session variables
session_write_close Write session data and close the session

cookie functions

setcookie() Set a cookie
setrawcookie Send a cookie without URL encoding

Date/Time functions

checkdate Validate a Gregorian date
date_add Alias DateTime::add
date_create_from_format Alias DateTime::createFromFormat
date_create Alias DateTime::__construct
date_date_set Alias DateTime::setDate
date_default_timezone_get Get the default timezone used by all date/time functions in a script
date_default_timezone_set Set the default timezone used by all date/time functions in a script
date_diff Alias DateTime::diff
date_format Alias DateTime::format
date_get_last_errors Alias DateTime::getLastErrors
date_interval_create_from_date_string Alias DateInterval::createFromDateString
date_interval_format Alias DateInterval::format
date_isodate_set Alias DateTime::setISODate
date_modify Alias DateTime::modify
date_offset_get Alias DateTime::getOffset
date_parse_from_format Get info about given date formatted according to the specified format
date_parse Returns associative array with detailed info about given date
date_sub Alias DateTime::sub
date_sun_info Returns an array with information about sunset/sunrise and twilight begin/end
date_sunrise Return the sunrise time for the given date and location
date_sunset Return the sunset time for the given date and location
date_time_set Alias DateTime::setTime
date_timestamp_get Alias DateTime::getTimestamp
date_timestamp_set Alias DateTime::setTimestamp
date_timezone_get Alias DateTime::getTimezone
date_timezone_set Alias DateTime::setTimezone
date Format a local time/date
getdate Get date/time information
gettimeofday Get the current time
gmdate Format a GMT/UTC date/time
gmmktime Get the UNIX timestamp for a GMT date
gmstrftime Format GMT/UTC time/date according to the locale settings
idate Format a local time/date as an integer
localtime Get the local time
microtime Return the current UNIX timestamp and microseconds
mktime Get the UNIX timestamp for a date
strftime Format the local time/date according to the locale settings
strptime Parse a date/time generated by strftime
strtotime Parse any English text date/time description into a UNIX timestamp
time Return the current UNIX timestamp
timezone_abbreviations_list Alias DateTimeZone::listAbbreviations
timezone_identifiers_list Alias DateTimeZone::listIdentifiers
timezone_location_get Alias DateTimeZone::getLocation
timezone_name_from_abbr Returns the timezone name from abbreviation
timezone_name_get Alias DateTimeZone::getName
timezone_offset_get Alias DateTimeZone::getOffset
timezone_open Alias DateTimeZone::__construct
timezone_transitions_get Alias DateTimeZone::getTransitions
timezone_version_get Gets the version of the timezonedb
PS: This reference table is an improvement based on common reference tables found online and can be used as a reference for PHP programmers to check function functionality. Due to limited time, there may be many shortcomings, and we welcome IT experts to provide valuable suggestions in the comments section~O(∩_∩)O~