Remeins Tools
Remeins Tools
All Daily Images PDF Document Media Voice Count Programmer Devise Text Contrast Interesting
Remeins,With

PHP Function Reference Table

The PHP Function Reference Table is a comprehensive list of functions available in the PHP programming language. It provides developers with detailed documentation and examples for each function, including its parameters, return values, and possible errors. This table is an essential resource for PHP programmers as it helps them to understand how to use different functions and how to accomplish specific tasks in their projects. Additionally, it helps them to save time and effort as they don't need to write functions from scratch. Overall, the PHP Function Reference Table is an invaluable tool for PHP developers of all levels.

td>

String-related operation functions

Remove spaces or other characters

trim Delete spaces or other predefined characters at both ends of the string
rtrim Delete spaces or other predefined characters from the right of a string
chop The alias chop() of rtrim() is different from Perl's chop() function in that it deletes the last character of a string.
ltrim Delete spaces or other predefined characters on the left of a string

String generation and conversion

str_pad Pad a string to a specified length with another string
str_replace Substring replacement
str_split Convert a string to an array
strrev Reverse a string
wordwrap Break a string into a specified number of words
str_shuffle Randomly shuffle a string
parse_str Parse a string into a variable
number_format Format a string by thousands grouping

String case conversion

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

html tag association

htmlentities Convert characters to HTML entities
htmlspecialchars Convert a predefined string to HTML encoding
nl2br Insert HTML line break tags before all new lines in the string \nConvert to <br> tags
strip_tags Strip HTML and PHP tags from a string
addcslashes C-style backslash escapes in a string
stripcslashes Dereference a string escaped with addcslashes()
addslashes Use backslashes to quote a string
stripslashes Remove escape characters added by addslashes
quotemeta Prefix certain predefined strings in string with backslash
chr Return the character from the specified ASCII value
ord Return the ASCII value of the first character of string

String comparison

strcasecmp Compare two strings case-insensitively
strcmp Compare two strings case-sensitively
strncmp Compare the first N characters of the string, case-sensitive
strncasecmp Compare the first N characters of a string, not case sensitive
strnatmpNatural order method to compare string length, case-sensitive
strnatcasecmp Natural order method to compare string length, 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 times a string appears in another string
substr_replace Replace a string in a string with another string
similar_text Return the number of identical characters in two strings
strrchr Returns a string from the last occurrence of a string in another string to the end of the string
strstr Returns a string from the start position to the end position of a string in another string
strchr Alias ​​of strstr, returns a string from the first occurrence of a string in another string to the end of the string
stristr Returns a string from the start position to the end position of a string in another string, case insensitive
strtr Convert certain characters in a string
strpos Find the first occurrence of certain characters in a string
stripos Find the first occurrence of certain characters in a string, case insensitive
strrpos Find the last occurrence of certain characters in a string
strripos Find the last position of certain characters in a string, not case sensitive
strspn Return the length of the first string that matches the mask in the string
strcspn Return the length of the string that does not match the mask in the string

String statistics

str_word_count Count the number of words in the string
strlen Count the length of the string
count_chars Count the number of times all letters appear in the string (0..255)

String encoding

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

Array related functions

Create an array

array Generate an array
array_combine Generate an array with the values ​​of one array as keys and the values ​​of another array as values
range Create and return an array containing the specified range of elements
compact Create an array consisting of the variables carried by the parameter
array_fill Fill the generated array with the 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 Take out a value from the array according to the conditions and return it.

Array comparison

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

Array search and replacement

array_splice Delete part of the array and replace other values
array_sum Returns the sum of all values ​​in an array
in_array Search for a specified value in an array, case sensitive
array_key_exists Judge whether a specified key exists in an array

Array pointer operations

key Return the key name currently pointed to by the internal pointer of the array
current Return the current element in the array
next Move the pointer pointing to the current element to the next element position and return the value of the current element
prev Move the pointer pointing to the current element to the previous element position and return the value of the current element
end Set the internal pointer of the array to the last element and return the value of the element (if successful)
reset Set the internal pointer of the array to the first element and return the value of the element
list Assign values ​​to a set of variables using elements in the array
array_shift Delete the first element in the array and return the value of the deleted element
array_unshif Insert one or more elements at the beginning of the array
array_push Push one or more elements to the end of the array
array_pop Delete the last element of the array

Array key value operation

shuffle Shuffle the array and keep the key name
count Calculate the number of cells or object attributes in the array
array_flip Return an array with key values ​​flipped
array_keys Return all the keys of the array to form an array
array_values Return all the values ​​in the array to form an array
array_reverse Return an array with the order of elements reversed
array_count_values Count the number of times all values ​​appear in the array
array_rand Randomly extract one or more elements from the array, note that it is the key name
each Return the current key/value pair in the array and move the array pointer forward one step
array_unique Remove duplicate values ​​from the array

Array sorting

sort Sort the array
rsort Sort the array in reverse order
asort Sort the array and keep the index relationship
arsort Sort the array in reverse order and keep the index relationship
ksort Sort the array by key name
krsort Sort the array in reverse order by key name
natsort Sort the array using the "natural sort" algorithm
natcasesort Sort the array using the "natural sort" algorithm without distinguishing uppercase and lowercase letters

Mathematical related functions

abs Find the absolute value
ceil Round up
floor Round down
fmod Return the floating point remainder of division
pow Return the Nth power of a number
round Floating point number rounding method
sqrt Find the square root
max Find the maximum value
min Find the minimum value
mt_rand Better random numbers
rand Random numbers
pi Get pi
octdec Convert octal to decimal

mysql related functions

mysql_affected_rows Get the number of rows affected by the previous MySQL operation
mysql_client_encoding Return the name of the character set
mysql_close Close the MySQL connection
mysql_connect Open a connection to a MySQL server
mysql_create_db Create a new MySQL database
mysql_data_seek Move the pointer of the internal result
mysql_db_name Get the result data
mysql_db_query Send a MySQL query
mysql_drop_db Drop (delete) a MySQL database
mysql_errno Returns the numeric code of the error message in the last MySQL operation
mysql_error Returns the text error message generated by the last MySQL operation
mysql_escape_string Escape a string for use in mysql_query
mysql_fetch_array Get a row from the result set as an associative array, a numeric array, or both
mysql_fetch_assoc Get a row from the result set as an associative array
mysql_fetch_field Get column information from the result set and return it as an object
mysql_fetch_lengths Get the length of each output in the result set
mysql_fetch_object Get a row from the result set as an object
mysql_fetch_object Get a row from the result set as an enumeration array
mysql_field_flags Get the flag associated with the specified field from the result
mysql_field_len Return the length of the specified field
mysql_field_name Get the field name of the specified field in the result
mysql_field_seek Set the pointer in the result set to the specified field offset
mysql_field_table Get the table name where the specified field is located
mysql_field_type Get the type of the specified field in the result set
mysql_free_result Free the result memory
mysql_get_client_info Get MySQL client information
mysql_get_host_info Get MySQL host information
mysql_get_proto_info Get MySQL protocol information
mysql_get_server_info Get MySQL server information
mysql_info Get the latest query information
mysql_insert_id Get the ID generated by the previous INSERT operation
mysql_list_dbs List all databases in 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 Get the number of fields in the result set
mysql_num_rows Get the number of rows in the result set
mysql_pconnect Open a persistent connection to the MySQL server
mysql_ping Ping a server connection, reconnect if not connected
mysql_query Send a MySQL query
mysql_real_escape_string Escape special characters in strings used in SQL statements, taking into account the current character set of the connection
mysql_result Get result data
mysql_select_db Select MySQL database
mysql_set_charset Sets the client character set
mysql_stat Get the current system status
mysql_tablename Get the table name
mysql_thread_id Returns the ID of the current thread
mysql_unbuffered_query Sends a SQL query to MySQL without getting and caching the result rows

File directory processing related functions

basename Returns the file name part of the path
chgrp Change the group to which the file belongs
chmod Change the file mode
chown Change the owner of the file
clearstatcache Clear the file status cache
copy Copy the file
delete See unlink or unset
dirname Returns the directory portion of a path
disk_free_space Returns the free space in a directory
disk_total_space Returns the total disk size of a directory
diskfreespace Alias ​​of disk_free_space
fclose Close an open file pointer
feof Test if the file pointer has reached the end of the file
fflush Output the buffer content to the file
fgetc Read characters from the file pointer
fgetcsv Read a line from the file pointer and parse the CSV fields
fgets Read a line from the file pointer
fgetss Read a line from the file pointer and filter out HTML tags
file_exists Check if a file or directory exists
file_get_contents Read the entire file into a string
file_put_contents Write a string to a file
file Read the entire file into an array
fileatime Get the last access time of the file
filectime Get the inode modification time of the file
filegroup Get the group of the file
fileinode Get the inode of the file
filemtime Get file modification time
fileowner Get file owner
fileperms Get file permissions
filesize Get file size
filetype Get file type
flock Lightweight advisory file locking
fnmatch Match filenames with a pattern
fopen Open a file or URL
fpassthru Output all remaining data at file pointer
fputcsv Format rows as CSV and write to file pointer
fputs Alias ​​of fwrite
fread Read from a file (binary-safe)
fscanf Format input from a file
fseek Position within a file pointer
fstat Get file information through the opened file pointer
ftell Return the position of the file pointer to read/write
ftruncate Truncate the file to a given length
fwrite Write to file (safe for binary files)
glob Find a file path that matches a pattern
is_dir Determine if the given file name is a directory
is_executable Determine if the given file name is executable
is_file Determine if the given file name is a normal file
is_readable Determine if the given file name is readable
is_uploaded_file Determine whether the file is uploaded via HTTP POST
is_writable Determine whether the given file name 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
mkdir Create a new directory
move_uploaded_file Move the uploaded file to a new location
parse_ini_file Parse a configuration file
parse_ini_string Parse a configuration string
pathinfo Return information about the file path
pclose Close the process file pointer
popen Open the process file pointer
readfile Output a file
realpath_cache_get Get realpath cache entries
realpath_cache_size Get realpath cache size
realpath Return the normalized absolute path name
rename Rename a file or directory
rewind Rewind the file pointer
rmdir Delete directory
set_file_buffer Alias ​​of stream_set_write_buffer
stat Give information about a file
tempnam Create a file with a unique file name
tmpfile Create a temporary file
touch Set the access and modification time of the file
umask Change the current umask

GD/Image function

gd_info Get the information of the currently installed GD library
getimagesize Get the image size
getimagesizefromstring Get the size of an image from a string
image_type_to_extension Get the file suffix of the image type
image_type_to_mime_type Get the MIME type of the image type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
image2wbmp Output the image to the browser or file in WBMP format
imagealphablending Set the image blending mode
imageantialias Whether to use antialiasing function
imagearc Draw an ellipse
imagechar Draw a character horizontally
imagecharup Draw a character vertically
imagecolorallocate Assign a color to an image
imagecolorallocatealpha Assign a color + alpha to an image
imagecolorat Get the color index value of a pixel
imagecolorclosest Get the index value of the color closest to the specified color
imagecolorclosestalpha Get the color closest to the specified color plus transparency
imagecolorclosesthwb Get the index of the black and white color closest to the given color
imagecolordeallocate Cancel the allocation of image colors
imagecolorexact Get the index value of the specified color
imagecolorexactalpha Get the index value of the specified color plus transparency
imagecolormatch Make the palette version of an image more closely match the true color version
imagecolorresolve Get the index value of the specified color or the closest possible alternative
imagecolorresolvealpha Get the index value of the specified color + alpha or the closest possible alternative value
imagecolorset Set the color for the specified palette index
imagecolorsforindex Get the color of a certain index
imagecolorstotal Get the number of colors in the palette of an image
imagecolortransparent Define a color as transparent
imageconvolution Apply a 3x3 convolution matrix with coefficients div and offset
imagecopy Copy part of the image
imagecopymerge Copy and merge part of the image
imagecopymergegray Copy and merge part of the image in grayscale
imagecopyresampled Resample and copy part of the image and resize it
imagecopyresized Copy part of an image and resize it
imagecreate Create a new image based on a palette
imagecreatefromgd2 Create a new image from a GD2 file or URL
imagecreatefromgd2part Create a new image from a given GD2 file or URL
imagecreatefromgd Create a new 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 a new image from the image stream in the 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 dotted line
imagedestroy Destroy an image
imageellipse Draw an ellipse
imagefill Region fill
imagefilledarc Draw an ellipse and fill it
imagefilledellipse Draw an ellipse and fill it
imagefilledpolygon Draw a polygon and fill it
imagefilledrectangle Draw a rectangle and fill it
imagefilltoborder Fill the area to the border of the specified color
imagefilter Apply a filter to the image
imagefontheight Get the font height
imagefontwidth Get font width
imageftbbox Give a text box using FreeType 2 fonts
imagefttext Write text to an image using FreeType 2 fonts
imagegammacorrect Apply gamma correction to a GD image
imagegd2 Exports GD2 images to a browser or file
imagegd Exports GD images to a browser or file
imagegif Exports images to a browser or file
imagegrabscreen Captures the whole screen
imagegrabwindow Captures a window
imageinterlace Enable or disable interlacing
imageistruecolor Check if the image is a true color image
imagejpeg Output the image to a browser or file
imagelayereffect Set alpha blending flag to use bundled libgd layering effect
imageline Draw a line segment
imageloadfont Load a new font
imagepalettecopy Copy the palette from one image to another
imagepng Output the image to the browser or file in PNG format
imagepolygon Draw a polygon
imagepsbbox Give a text box using PostScript Type1 font
imagepsencodefont Change the character encoding vector in the font
imagepsextendfont Expand or simplify fonts
imagepsfreefont Release aMemory used by PostScript Type 1 fonts
imagepsloadfont Load a PostScript Type 1 font from a file
imagepsslantfont Tilt a font
imagepstext Draw a text string on an image using a PostScript Type 1 font
imagerectangle Draw a rectangle
imagerotate Rotate the image by a given angle
imagesavealpha Sets a flag to save the full alpha channel information when saving PNG images (as opposed to a single transparent color)
imagesetbrush Sets the brush image used for drawing lines
imagesetpixel Draw a single pixel
imagesetstyle Set the style of the line
imagesetthickness Set the width of the line
imagesettile Set the texture used for filling
imagestring Draw a line of strings horizontally
imagestringup Draw a line of strings vertically
imagesx Get the image width
imagesy Get the image height
imagetruecolortopalette Convert a true color image to a paletted image
imagettfbbox Get the range of text using TrueType fonts
imagettftext Write text to an image using TrueType fonts
imagetypes Returns the image types supported by the current version of PHP
imagewbmp Export an image to a browser or file in WBMP format
imagexbm Export an XBM image to a browser or file
iptcembed Embed binary IPTC data into a JPEG image
iptcparse Export binary IPTC http://www.iptc.org/ Blocks are parsed into individual tags
jpeg2wbmp Convert JPEG image files to WBMP image files
png2wbmp Convert PNG image files to WBMP image files

session function

session_cache_expire Return the current cache expiration
session_cache_limiter Get and set the current cache limit/gold
session_commit Alias ​​of session_write_close
session_decode Encode session data from a session to a string
session_destroy Destroy all data registered to the session
session_encode Encode the current session data to a string
session_id Get and/or set the current session identifier
session_is_registered Check if the variable is already 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 newly generated session ID
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 function
session_start Start a new or resume an existing session
session_status Return the current session status
session_unregister Unregister a global variable of the current session
session_unset Free all session variables
session_write_close Write session data and end session

cookie function

setcookie() Set cookies
setrawcookie Send cookies 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 time zone used by all date and time functions in a script
date_default_timezone_set Sets the default time zone for all date and 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 Returns the sunrise time for a given date and location
date_sunset Returns the sunset time for a 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 of the GMT date
gmstrftime Format the GMT/UTC time/date according to the locale
idate Format the local time date as an integer
localtime Get local time
microtime Return current Unix timestamp and microseconds
mktime Get Unix timestamp of a date
strftime Format local time/date according to locale
strptime Parse date/time generated by strftime
strtotime Parse any English text date and 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