PHP Common Functions Encyclopedia

Source: Internet
Author: User

PHP functions

The Usleep () function delays code execution for several microseconds.
The unpack () function unpack the data from a binary string.
The Uniqid () function generates a unique ID based on the current time in microseconds.
The Time_sleep_until () function delays code execution until the specified time.
The Time_nanosleep () function delays code execution for several seconds and nanoseconds.
The sleep () function delays code execution for several seconds.
The Show_source () function highlights the file syntax.
The Strip_whitespace () function returns the source code file for the deleted PHP comments and whitespace characters.
The pack () function loads the data into a binary string.
The Ignore_user_abort () function sets the execution of the script to terminate if the client disconnects.
The highlight_string () function highlights the syntax of a string.
The Highlight_file () function highlights the file syntax.
The Get_browser () function returns the performance of the user's browser.
The exit () function outputs a message and exits the current script.
The eval () function calculates the string according to the PHP code.
The die () function outputs a message and exits the current script.
The defined () function checks to see if a constant exists.
The Define () function defines a constant.
The constant () function returns the value of a constant.
The Connection_status () function returns the current connection state.
The connection_aborted () function checks to see if the client is disconnected.
The Zip_read () function reads the next file in the Open zip archive.
The Zip_open () function opens a ZIP file for reading.
The Zip_entry_read () function obtains content from an open zip archive project.
The Zip_entry_open () function opens a ZIP archive entry for reading.
The Zip_entry_name () function returns the name of the ZIP archive item.
The Zip_entry_filesize () function returns the original size of the ZIP archive item (before compression).
The Zip_entry_compressionmethod () function returns the compression method of the ZIP archive item.
The Zip_entry_compressedsize () function returns the compressed file size of a ZIP archive item.
The Zip_entry_close () function closes the zip archive file opened by the Zip_entry_open () function.
The Zip_close () function closes the zip archive file opened by the Zip_open () function.
The Xml_set_unparsed_entity_decl_handler () function specifies the function that is called when an unresolved entity name (NDATA) declaration is encountered.
The Xml_set_processing_instruction_handler () function specifies the function that is called when the parser finds processing instructions in an XML document.
The Xml_set_object () function allows an XML parser to be used in an object.
The Xml_set_notation_decl_handler () function specifies the function that is called when the parser finds a symbolic declaration in an XML document.
The Xml_set_external_entity_ref_handler () function specifies the function that is called when the parser finds an external entity in the XML document.
The Xml_set_element_handler () function establishes the starting and terminating element processors.
The Xml_set_default_handler () function establishes the default data processor for the XML parser.
The Xml_set_character_data_handler () function establishes a character data processor.
The Xml_parser_set_option () function sets the option for the XML parser.
The Xml_parser_get_option () function obtains the option setting information from the XML parser.
The Xml_parser_free () function frees the XML parser.
The Xml_parser_create () function creates an XML parser.
The Xml_parser_create_ns () function creates an XML parser with namespace support.
The Xml_parse_into_struct () function parses the XML data into an array.
The Xml_parse () function parses the XML document.
The Xml_get_error_code () function gets the XML parser error code.
The Xml_get_current_line_number () function gets the current line number of the XML parser.
The Xml_get_current_column_number () function Gets the current column number of the XML parser.
The Xml_get_current_byte_index () function gets the current byte index of the XML parser.
The xml_error_string () function Gets the error description of the XML parser.
The Utf8_encode () function encodes the iso-8859-1 string as UTF-8.
The Utf8_decode () function decodes the UTF-8 string to iso-8859-1.
The WordWrap () function handles string wrapping at a specified length.
The vsprintf () function writes a formatted string to a variable.
The vprintf () function outputs a formatted string.
The vfprintf () function writes a formatted string to the specified output stream.
The Ucwords () function converts the first character of each word in a string to uppercase.
The Ucfirst () function converts the first character in a string to uppercase.
The trim () function removes white-space characters and other predefined characters from both ends of the string.
The Substr_replace () function replaces part of a string with another string.
The Substr_count () function calculates the number of occurrences of a substring in a string.
The Substr_compare () function compares two strings from a specified start length.
The substr () function returns a portion of a string.
The STRTR () function converts a specific character in a string.
The Strtoupper () function converts a string to uppercase.
The Strtolower () function converts a string to lowercase.
The Strtok () function splits a string into smaller strings.
The Strstr () function searches for the first occurrence of a string in another string.
The STRSPN () function returns the number of specific characters contained in the string.
The Strrpos () function finds the position of the last occurrence of a string in another string.
The Strripos () function finds the position of the last occurrence of a string in another string.
The Strrev () function reverses the string.
The STRRCHR () function finds the last occurrence of a string in another string and returns all characters from that position to the end of the string.
The Strpos () function returns the position of the first occurrence of a string in another string.
The STRPBRK () function searches the string for any one of the specified characters.
The strncmp () function compares two strings.
The strncasecmp () function compares two strings.
The strnatcmp () function uses a "natural" algorithm to compare two of strings.
The strnatcasecmp () function uses a "natural" algorithm to compare two of strings.
The strlen () function returns the length of the string.
The Stristr () function finds the position of the first occurrence of a string in another string.
The Stripos () function returns the position of the first occurrence of a string in another string.
The Stripslashes () function deletes a backslash added by the addslashes () function.
The Stripcslashes () function deletes a backslash added by the addcslashes () function.
The Strip_tags () function strips HTML, XML, and PHP tags.
The STRCSPN () function returns the number of characters to look up in a string before any of the specified characters are found.
The Strcoll () function compares two strings.
The strcmp () function compares two strings.
The STRCHR () function searches for the first occurrence of a string in another string.
The strcasecmp () function compares two strings.
The Str_word_count () function calculates the number of words in a string.
The Str_split () function splits a string into an array.
The Str_shuffle () function randomly scrambles all characters in a string.
The str_rot13 () function performs ROT13 encoding on the string.
The Str_replace () function replaces some other characters in a string with a string.
The Str_repeat () function repeats a string for a specified number of times.
The Str_pad () function fills a string with the specified length.
The Str_ireplace () function replaces some other characters in a string with a string.
The sscanf () function parses input from a string according to the specified format.
The sprintf () function writes a formatted string to a variable.
The SOUNDEX () function computes the Soundex key for the string.
The Similar_text () function calculates the number of matching characters for two strings.
The Sha1_file () function computes the SHA-1 hash of the file.
The SHA1 () function computes the SHA-1 hash of the string.
The setlocale () function sets the region information (geographic information).
RTrim () P RTrim () function
PHP String function
The Quotemeta () function adds a backslash before some of the predefined characters in the string.
The Quoted_printable_decode () function decodes a quoted-printable encoded string, returning a 8-bit string.
The printf () function outputs a formatted string.
The print () function outputs one or more strings.
The Parse_str () function parses the query string into a variable.
The Ord () function returns the ASCII value of the first character of a string.
The Number_format () function formats numbers by using thousands of groupings.
The NL2BR () function inserts an HTML line break (<br/>) before each new line (\ n) in the string.
The Nl_langinfo () function returns the specified local information.
The Money_format () function formats the string as a currency string.
The Metaphone () function computes the Metaphone key for the string.
The Md5_file () function computes the MD5 hash of the file.
The MD5 () function computes the MD5 hash of the string.
The LTrim () function removes spaces or other predefined characters from the left side of the string.
The Localeconv () function returns an array that contains the local numeric and currency information format.
The Levenshtein () function returns the Levenshtein distance between two strings.
The join () function combines array elements into a single string.
The implode () function combines array elements into a single string.
The Htmlspecialchars () function converts some pre-defined characters to HTML entities.
Html_entity_decode () Chars_decode () function

PHP String function
The Htmlentities () function converts a character to an HTML entity.
The Html_entity_decode () function converts an HTML entity to a character.
The HEBREVC () function converts a right-to-left stream of Hebrew text to a left-to-right stream. It also converts the new line (\ n) to <br/>.
The Hebrev () function converts a right-to-left stream of Hebrew text to a left-to-right stream.
The get_html_translation_table () function returns the translation tables used by the htmlentities () and Htmlspecialchars () functions.
The fprintf () function writes a formatted string to the specified output stream (for example, a file or database).
The explode () function splits the string into arrays.
The Echo () function outputs one or more strings.
The crypt () function returns a string that is encrypted with DES, Blowfish, or MD5.
The CRC32 () function computes the crc32 polynomial of a string.
The Count_chars () function returns information about the characters used in the string.
The Convert_uuencode () function encodes a string using the uuencode algorithm.
The Convert_uudecode () function decodes a uuencode encoded string.
The convert_cyr_string () function converts a character from one Cyrillic character to another.
The Chunk_split () function splits a string into a series of smaller parts.
The CHR () function returns characters from the specified ASCII value.
The chop () function removes whitespace characters or other predefined characters starting at the end of the string.
The Bin2Hex () function converts a string of ASCII characters to a hexadecimal value.
The Addslashes () function adds a backslash before the specified predefined character.
The Addcslashes () function adds a backslash before the specified character.
The XPath () function runs an XPath query to an XML document.
The simplexml_load_string () function loads an XML string into the object.
The simplexml_load_file () function loads an XML document into an object.
The Simplexml_import_dom () function converts a DOM node to a SimpleXMLElement object.
The Registerxpathnamespace () function creates a namespace context for the next XPath query.
The GetNamespace () function gets the namespaces that are used in the XML document.
The GetName () function Gets the name of the XML element from the SimpleXMLElement object.
The Getdocnamespaces () function returns the namespace declared in the XML document from the SimpleXMLElement object.
The children () function gets the child nodes of the specified node.
The attributes () function gets the properties of the Simplexml element.
The Asxml () function returns an XML document from a SimpleXMLElement object in the form of a string.
The AddChild () function adds a child node to the specified XML node.
The AddAttribute () function adds an attribute to the Simplexml element.
The __construct () function creates a new SimpleXMLElement object.
The Mysql_unbuffered_query () function sends a SQL query to MySQL (the results are not fetched/cached).
The mysql_thread_id () function returns the ID of the current thread.
The Mysql_stat () function returns the current system state of the MySQL server.
The mysql_select_db () function sets the active MySQL database.
The mysql_result () function returns the value of a field in the result set.
The mysql_real_escape_string () function escapes special characters in strings used in SQL statements.
The mysql_query () function executes a MySQL query.
The mysql_ping () function pings a server connection and re-connects if there is no connection.
The Mysql_pconnect () function opens a persistent connection to the MySQL server.
The mysql_num_rows () function returns the number of rows in the result set.
The Mysql_num_fields () function returns the number of fields in the result set.
The mysql_list_processes () function lists the MySQL process.
The Mysql_list_dbs () function lists all databases in the MySQL server.
The mysql_insert_id () function returns the ID generated by the previous insert operation.
The Mysql_info () function returns information for the most recent query.
The Mysql_get_server_info () function returns information about the MySQL server.
The Mysql_get_proto_info () function returns information about the MySQL protocol.
The Mysql_get_host_info () function returns information about the MySQL host.
The Mysql_get_client_info () function returns the MySQL client information.
The Mysql_free_result () function frees the resulting memory.
The Mysql_field_type () function returns the type of the specified field in the result set.
The mysql_field_table () function returns the name of the table that contains the specified field.
The Mysql_field_seek () function sets the pointer in the result set to the specified field offset.
The Mysql_field_name () function obtains the field name of the specified field in the result.
The Mysql_field_len () function returns the length of the specified field.
The Mysql_field_flags () function obtains the flags associated with the specified field from the result.
The Mysql_fetch_row () function takes a row from the result set as a numeric array.
The Mysql_fetch_object () function takes a row from the result set (Recordset) as an object.
The Mysql_fetch_lengths () function Gets the length of the contents of each field in a row.
The Mysql_fetch_field () function obtains column information from the result set and returns it as an object.
The MYSQL_FETCH_ASSOC () function obtains a row from the result set as an associative array.
The Mysql_fetch_array () function takes a row from the result set as an associative array, or as a numeric array, or both
The Mysql_error () function returns the text error message generated by the previous MySQL operation.
The Mysql_errno () function returns the numeric encoding of the error message in the previous MySQL operation.
The Mysql_db_name () function obtains the name of the database returned by the Mysql_list_dbs () call.
The Mysql_data_seek () function moves the pointer to the internal result.
The mysql_connect () function opens a non-persistent MySQL connection.
The Mysql_close () function closes a non-persistent MySQL connection.
The mysql_client_encoding () function returns the name of the currently connected character set.
The Mysql_affected_rows () function returns the number of record rows affected by the previous MySQL operation.
The Tanh () function returns the hyperbolic tangent.
The tan () function returns the tangent.
The Srand () function sows the random number generator seed.
The sqrt () function returns the square root of a number.
The Sinh () function returns the hyperbolic sine of a number.
The sin () function returns the sine of a number.
The round () function rounds a floating-point number.
The rand () function returns a random integer.
The Rad2deg () function converts the number of radians to the number of angles.
The POW () function returns the Y-side of X.
The PI () function returns the value of pi.
The Octdec () function converts octal into decimal.
Mt_srand () Seeding Mersenne Twister random number generator.
Mt_rand () returns a random integer using the Mersenne Twister algorithm.
Mt_getrandmax () Displays the maximum possible value for the random number.
MIN () returns the minimum value.
Max () returns the maximum value.
LOG1P () returns log (1 + x), and even when the value of x is close to 0, the exact result can be calculated.
LOG10 () The logarithm of the base 10.
Log () returns the natural logarithm.
Lcg_value () combined linear congruence generator.
Is_nan () Determines whether it is a valid value.
Is_infinite () Determines whether it is an infinite value.
The Is_finite () function determines whether it is a finite value.
The Hypot () function calculates the hypotenuse length of the triangle at all angles.
The Hexdec () function converts the 16 binary to decimal.
The Fmod () function displays the maximum possible value for the random number.
The Fmod () function returns the remainder of the floating-point number of divisions.
The floor () function rounds down to the nearest integer.
The EXPM1 () function returns exp (x)-1, even when the value of number is close to 0 to calculate the exact result.
The exp () function calculates the exponent of E.
The Deg2rad () function converts the angle to radians.
The DECOCT () function converts decimal into octal.
The Dechex () function converts decimal to 16 binary.
The Decbin () function converts decimal into binary.
The cosh () function returns the hyperbolic cosine of a number.
The Cos () function returns the cosine of a number.
The Ceil () function rounds up to the nearest integer.
The Bindec () function converts the binary into decimal.
The Base_convert () function converts numbers between arbitrary binaries.
The Atanh () function returns the inverse hyperbolic tangent of an angle.
Atan () and atan2 () and atan2 () functions

PHP Math function
Atan () and atan2 () and atan2 () functions

PHP Math function
The Asinh () function returns the inverse hyperbolic sine of a number.
The ASIN () function returns the inverse of a different value, and the result is a radian value between-PI/2 and PI/2.
The Acosh () function returns the inverse hyperbolic cosine of a number.
The ACOs () function returns the inverse cosine of a number.
The ABS () function returns the absolute value of a number.
The mail () function allows you to send e-mail directly from a script.
The Libxml_use_internal_errors () function disables standard libxml errors and enables user error handling.
The Libxml_get_last_error () function gets the last error from the libxml error buffer.
The Libxml_get_errors () function gets an error from the libxml error buffer.
The Libxml_clear_errors () function empties the libxml error buffer.
The Setrawcookie () function does not URL-encode the cookie value and sends an HTTP cookie.
The Setcookie () function sends an HTTP cookie to the client.
The Headers_sent () function checks to see if the HTTP header is sent/sent to.
The Headers_list () function returns a list of sent (or pending) response headers.
The header () function sends the original HTTP header to the client.
The Ftp_systype () function returns the system type identifier of the remote FTP server.
The Ftp_ssl_connect () function opens a secure ssl-ftp connection.
The Ftp_size () function returns the size of the specified file.
The Ftp_site () function sends the site command to the server.
The Ftp_set_option () function sets various FTP run-time options.
The Ftp_rmdir () function deletes a directory.
The Ftp_rename () function changes the file or directory name on the FTP server.
The Ftp_rawlist () function returns a detailed list of the files in the specified directory.
The Ftp_raw () function sends a raw command to the FTP server.
The Ftp_quit () function closes the FTP connection.
The FTP_PWD () function returns the current directory name.
The Ftp_put () function uploads the file to the server.
The FTP_PASV () function sets the passive mode to on or off.
The Ftp_nlist () function returns a list of files for the specified directory.
The Ftp_nb_put () function uploads the file to the server (non-blocking).
The Ftp_nb_get () function obtains the file from the FTP server and writes to the local file (non-blocking).
The Ftp_nb_fput () function uploads an open file and saves it as a file (non-blocking) on the FTP server.
The Ftp_nb_fget () function downloads a file from the FTP server and saves it to a file that is already open locally (non-blocking).
The Ftp_nb_continue () function gets/sends the file continuously.
The Ftp_mkdir () function creates a new directory on the FTP server.
The Ftp_mdtm () function returns the last modified time of the specified file.
The Ftp_login () function logs on to the FTP server.
The Ftp_get () function downloads a file from the FTP server.
The Ftp_get_option () function returns the various options settings for the current FTP connection.
The Ftp_fput () function uploads an already opened file to the FTP server.
The Ftp_fget () function downloads a file from the FTP server and saves it to a local file that is already open.
The Ftp_exec () function requests that a program or command be executed on the FTP server.
The Ftp_delete () function deletes a file on the FTP server.
The Ftp_connect () function establishes a new FTP connection.
The Ftp_close () function closes the FTP connection.
The Ftp_chmod () function sets permissions on the specified file on the FTP server.
The Ftp_chdir () function changes the current directory on the FTP server.
The Ftp_cdup () function changes the current directory to the parent directory on the FTP server.
The Ftp_alloc () function allocates space for files to be uploaded to the FTP server.
The Filter_var () function filters variables by the specified filter.
The Filter_var_array () function gets the multiple variables and filters them.
The Filter_list () function returns an array that contains all the supported filters.
The Filter_input_array () function obtains multiple inputs from outside the script and filters them.
The Filter_input () function takes input from outside the script and filters it.
The filter_id () function returns the ID number of the specified filter.
The Filter_has_var () function checks for the existence of a variable of the specified input type.
The unlink () function deletes the file.
The Umask () function changes the current umask.
The touch () function sets the access and modification times for the specified file.
The Tmpfile () function establishes a temporary file with a unique file name in read-write (w+) mode.
The Tempnam () function creates a temporary file with a unique file name.
The Symlink () function creates a symbolic connection.
The stat () function returns information about the file.
The Set_file_buffer () function sets the buffer size of the open file.
The RmDir () function removes the empty directory.
The rewind () function returns the position of the file pointer back to the beginning of the file.
The rename () function renames the file or directory.
The Realpath () function returns an absolute path.
The Readlink () function returns the target to which the symbolic connection is directed.
The ReadFile () function outputs a file.
The Popen () function opens the process file pointer.
The Pclose () function closes the pipe opened by Popen ().
The PathInfo () function returns information about the file path in the form of an array.
The Parse_ini_file () function parses a configuration file and returns the settings in the form of an array.
The Move_uploaded_file () function moves the uploaded file to a new location.
The mkdir () function creates a directory.
The Lstat () function returns information about a file or symbolic connection.
The LinkInfo () function returns information about the connection.
The link () function establishes a hard connection.
The is_writeable () function determines whether the specified file is writable.
The is_writable () function determines whether the specified file is writable.
The Is_uploaded_file () function determines whether the specified file was uploaded via HTTP POST.
The is_readable () function determines whether the specified file name is readable.
The Is_link () function determines whether the specified file name is a symbolic connection.
The Is_file () function checks whether the specified file name is normal.
The is_executable () function checks whether the specified file can be executed.
The Is_dir () function checks whether the specified file is a directory.
The Glob () function returns the file name or directory that matches the specified pattern.
The fwrite () function writes to the file (which is safe for binary files).
The Ftruncate () function truncates the file to the specified length.
The Ftell () function is in the current position in the open file.
The Fstat () function returns information about the open file.
The fseek () function is positioned in the open file.
The fscanf () function parses input from an open file according to the specified format.
The Fread () function reads the file (which can be used safely in binary files).
The fputs () function writes to the file (which is safe for binary files).
The Fputcsv () function formats the row as CSV and writes an open file.
The Fpassthru () function outputs all the remaining data at the file pointer.
The fopen () function opens the file or URL.
The Fnmatch () function matches the file name or string according to the specified pattern.
The flock () function locks or releases files.
The filetype () function returns the type of the specified file or directory.
The FileSize () function returns the size of the specified file.
The Fileperms () function returns permissions for a file or directory.
The Fileowner () function returns the owner of the file.
The Filemtime () function returns the last modified time of the file's contents.
The Fileinode () function returns the inode number of the file.
The filegroup () function returns the group ID of the specified file.
The Filectime () function returns the last Inode modification time for the specified file.
The Fileatime () function returns the last access time for the specified file.
The file_put_contents () function writes a string to the file.
The file_get_contents () function reads the entire file into a string.
The file_exists () function checks whether a file or directory exists.
The file () function reads entire files into an array.
The FGETSS () function reads a row from an open file and filters out HTML and PHP tags.
The fgets () function reads a row from the file pointer.
The Fgetcsv () function reads a row from the file pointer and resolves the CSV field.
The FGETC () function reads a character from the file pointer.
The Fflush () function outputs the buffered content to a file.
The feof () function detects if the end of file (EOF) has been reached.
The fclose () function closes an open file.
The Diskfreespace () function returns the free space in the directory. The function is an alias of the Disk_free_space () function.
The Disk_total_space () function returns the total disk size of the specified directory.
The Disk_free_space () function returns the free space in the directory
The DirName () function returns the directory portion of the path.
The Clearstatcache () function copies the file.
The Clearstatcache () function clears the file state cache.
The Chown () function changes the owner of the specified file.
The chmod () function changes the file mode.
The CHGRP () function changes the group to which the file belongs.
The basename () function returns the file name portion of the path.
Set_exception_handler () handler () function

PHP Error and Logging functions
The Set_exception_handler () function sets the user-defined exception handling function.
The Set_error_handler () function sets the user-defined error-handling function.
The Restore_exception_handler () function restores the exception handler before it is changed by the Set_exception_handler () function.
The Restore_error_handler () function restores the previous error handler, which is changed by the Set_error_handler () function.
Error_reporting () Sets the error level for PHP and returns the current level.
The Error_log () function sends an error to the server error record, file, or remote destination.
The Error_get_last () function gets the last error that occurred.
The Debug_print_backtrace () function outputs backtrace.
Debug_backtrace () Cktrace () function

PHP Error and Logging functions
The Scandir () function returns an array that contains the files and directories in the specified path.
The Rewinddir () function resets the directory handle opened by Opendir ().
The Readdir () function returns an entry in a directory handle opened by Opendir ().
The Opendir () function opens a directory handle that can be used by Closedir (), Readdir (), and Rewinddir ().
The GETCWD () function returns the current directory.
The Closedir () function closes the directory handle opened by the Opendir () function.
The Dir () function opens a directory handle and returns an object. This object consists of three methods: Read (), rewind (), and Close ().
The chroot () function changes the root directory of the current process to the specified directory.
The ChDir () function changes the current directory to the specified directory.
The time () function returns the Unix timestamp for the current time.
The strtotime () function resolves the datetime description of any English text to a Unix timestamp.
The strptime () function resolves the date/time generated by strftime ().
The strftime () function formats the local time/date according to the locale setting.
The Mktime () function returns a Unix timestamp for a date.
The Microtime () function returns the current Unix timestamp and the number of microseconds.
The localtime () function returns the local time (an array).
The Idate () function formats the local time/date as an integer.
The Gmstrftime () function formats the GMT/UTC time/date based on local locale settings.
The Gmmktime () function obtains a UNIX timestamp for the GMT date.
The Gmdate () function formats the GMT/UTC date/time.
The Gettimeofday () function returns an array containing the current time information.
The GETDATE () function obtains the date/time information.
The date () function formats a local time/date.
The Date_sunset () function returns the sunset time for the specified date and place.
The Date_sunrise () function returns the sunrise time for the specified date and place.
The Date_default_timezone_set () function sets the default time zone for all date/time functions used in the script.
The Date_default_timezone_get () function returns the default time zone used by all date-time functions in the script.
The Checkdate () function validates a trellis-high-date.
The UNIXTOJD () function converts a Unix timestamp to a Julian day count.
The JULIANTOJD () function converts the Julian calendar into a Julian day count.
The JEWISHTOJD () function converts the Jewish calendar into a Julian day count.
The Jdtounix () function converts the Julian day count to the Unix timestamp.
Jdtogregorian () Lian () function

PHP Array function
Jdtogregorian () Wish () function

PHP Array function
The Jdtogregorian () function converts the Julian day count to the Gregorian calendar.
The Jdtofrench () function converts the Julian day count to the calendar of the Republic of France.
The Jdmonthname () function returns the month string for the specified calendar.
The Jddayofweek () function returns the day of the week.
The GREGORIANTOJD () function converts the Gregorian calendar into a Julian day count.
The FRENCHTOJD () function converts the French Republican calendar into a Julian day count.
The Easter_days () function returns the number of days between Easter and March 21 for the specified year.
The Easter_date () function returns the Unix timestamp for the specified year of Easter midnight.
The CAL_TO_JD () function converts the specified date to a Julian day count.
The Cal_info () function returns an array that contains information about a given calendar.
The CAL_FROM_JD () function converts the Julian day count to the date of the specified calendar.
The Cal_days_in_month () function returns the number of days in one months for the specified year and calendar.
The Usort () function uses a user-defined function to sort the array.
The Uksort () function uses a user-defined comparison function to sort the array by key name and maintain the index relationship.
The Uasort () function uses a user-defined comparison function to sort the array and keep the index associated (no new keys are assigned to the element).
The sort () function sorts the values of the given array in ascending order.
The sizeof () function calculates the number of cells in an array or the number of properties in an object.
The shuffle () function rearranges the elements in the array in random order.
The Rsort () function reverses the order of the elements of the array by key values. The function is basically the same as Arsort ().
The reset () function points the inner pointer of the array to the first element and returns the value of the element.
The range () function creates and returns an array of elements that contain the specified range.
Prev () HP prev () function

PHP Array function
The POS () function is an alias of the current () function. It can return the value of the current element in the array.
The next () function moves the pointer to the current element to the position of the next element and returns the value of the current element.
The Natsort () function sorts the elements in a given array with a natural order algorithm.
The Natcasesort () function sorts the elements in a given array with a natural, case-insensitive order algorithm.
The list () function assigns values to a set of variables using the elements in the array.
The Ksort () function sorts the array by key name, preserving the original key for the array value.
The Krsort () function reverses the array by key, preserving the original key for the set value.
The key () function returns the key name of the array inside the pointer that currently points to the element.
The In_array () function searches the array for the given value.
Extract () Extract () function

PHP Array function
The end () function points the array's internal pointer to the last element and returns the value of the element, if successful.
The each () function generates an array of the key names and key values of the elements pointed to by the current internal pointer to the array, and moves the internal pointer forward.
The current () function returns the element (cell) in the array.
The count () function calculates the number of cells in an array or the number of properties in an object.
The compact () function creates an array of variables with the arguments. If an array exists in the parameter, the value of the variable in the array is also fetched.
The Asort () function sorts the array and maintains the index relationship. It is primarily used to sort the associative arrays that are important for the cell order.
The Arsort () function reverses the array and maintains the index relationship. It is primarily used to sort the associative arrays that are important for the cell order.
Array_walk_recursive () cursive () function

PHP Array function
The Array_walk () function applies a callback function to each element in the array. Returns TRUE if successful, otherwise FALSE.
The Array_values () function returns an array that contains all the key values in the given array, but does not preserve the key names.
The Array_unshift () function inserts one or more elements at the beginning of the array.
The Array_unique () function shifts the duplicate values in the array and returns the result arrays.
The Array_uintersect_assoc () function takes an index check to compute the intersection of an array and compares the data with a callback function.
The Array_uintersect () function computes the intersection of an array and compares the data with a callback function.
The ARRAY_UDIFF_UASSOC () function returns a portion of the array1 array that does not exist in the other array. The key names in the returned array remain unchanged.
The ARRAY_UDIFF_ASSOC () function returns a portion of the array1 that does not exist in the other array.
The Array_udiff () function returns an array that contains all the values in the array being compared, but not in any other parameter array, and the key name remains unchanged.
The Array_sum () function returns the sum of all the values in the array.
The Array_splice () function, like the Array_slice () function, selects a series of elements in an array, but does not return, but instead deletes them and replaces them with other values.
The Array_slice () function takes a value out of the array and returns it as a condition.
The Array_shift () function deletes the first element in the array and returns the value of the deleted element.
The Array_search () function, like In_array (), looks for a key value in the array. If the value is found, the key name of the matching element is returned. Returns False if it is not found.
The Array_reverse () function flips the order of elements in the original array, creates a new array, and returns. If the second parameter is specified as true, the key name of the element remains unchanged or the key names are lost.
The Array_reduce () function iteratively simplifies the array to a single value using a callback function. If you specify a third parameter, the parameter is treated as the first value in the array, or the final return value if the array is empty.
The Array_rand () function randomly selects one or more elements from the array and returns them.
The Array_push () function adds one or more elements (into the stack) to the end of the array of the first parameter, and then returns the length of the new array.
The array_product () function computes and returns the product of all the values in the array.
The Array_pop () function deletes the last element in the array.
The Array_pad () function inserts a specified number of elements with a specified value into an array.
The Array_multisort () function sorts multiple arrays or multidimensional arrays.
The array_merge_recursive () function, like the Array_merge () function, merges the elements of one or more arrays and appends the values in an array to the previous array. and returns an array as the result.
The Array_merge () function merges two or more arrays into an array.
The Array_map () function returns an array after the user-defined function is functional. The number of arguments that the callback function accepts should be the same as the number of arrays passed to the Array_map () function.
The Array_keys () function returns a new array that contains all the key names in the array.
The array_key_exists () function determines whether the specified key exists in an array, returns TRUE if the key exists, or false otherwise.
The Array_intersect_ukey () function calculates the intersection of an array by comparing the key names with the callback function.
The ARRAY_INTERSECT_UASSOC () function computes the intersection of an array using a user-defined callback function and compares the index with a callback function.
The Array_intersect_key () function computes the intersection of an array using the key name comparison.
The ARRAY_INTERSECT_ASSOC () function returns an array of intersections of two or more arrays.
The Array_intersect () function returns an array of intersections of two or more arrays.
The Array_flip () function returns an inverted array, and if the same value occurs more than once, the last key name is the value, and all other key names are lost.
The Array_filter () function filters the elements in the array with a callback function, and if the custom filter function returns True, the current value of the array being manipulated is included in the returned result array, and the result is a new array. If the original array is an associative array, the key name remains unchanged.
The Array_fill () function populates the array with the given values, the returned array has number elements, and the value is values. The returned array uses a numeric index, starting from the start position and incrementing. If number is 0 or less than 0, an error occurs.
Array_diff_ukey () returns an array that contains all the values that appear in the array1 but do not appear in any of the other parameter array's key names. Note that the association relationship remains unchanged. Unlike Array_diff (), comparisons are made by key names rather than values.
The ARRAY_DIFF_UASSOC () function uses a user-defined callback function (callback) to perform an index check to calculate the difference between two or more arrays. Returns an array that contains the values in Array1 but not in any other parameter array.
The Array_diff_key () function returns an array that contains all the keys in the array being compared, but not in any other parameter array.
The ARRAY_DIFF_ASSOC () function returns an array of difference sets for two arrays. The array includes all the keys and values in the array being compared, but not in any other parameter array.
The Array_diff () function returns an array of difference sets for two arrays. The array includes all of the key values in the array being compared, but not in any other parameter array.
The Array_count_values () function is used to count the occurrences of all values in an array.
The Array_combine () function creates a new array by merging two arrays, one of which is the key name and the value of the other array is the key value.
The Array_chunk () function splits an array into a new array block.
The Array_change_key_case () function converts all keys of an array to uppercase or lowercase.
Array () creates arrays with keys and values. If the key is omitted when the array is specified, an integer key is generated, starting with 0 and incrementing by 1.

PHP Common Functions Encyclopedia

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.