Home  >  Article  >  Backend Development  >  PHP5 function summary (share)_PHP tutorial

PHP5 function summary (share)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:08:51718browse

Many PHP seniors have written PHP encyclopedias, but I looked at them and found that those so-called "encyclopedias" are not complete at all, and there are even fewer functions than the list I compiled. They even named them "encyclopedias", which makes me not angry. Going in the opposite direction, the whole "puppy" thing.

usleep() function delays code execution for a number of microseconds.
The unpack() function unpacks 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 a number of seconds and nanoseconds.
The sleep() function delays code execution for a few seconds.
The show_source() function performs syntax highlighting on files.
The strip_whitespace() function returns the source code file with PHP comments and whitespace characters removed.
The pack() function loads data into a binary string.
ignore_user_abort() function sets whether disconnecting from the client will terminate the execution of the script.
The highlight_string() function performs syntax highlighting on strings.
The highlight_file() function performs syntax highlighting on files.
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 evaluates strings according to PHP code.
The die() function outputs a message and exits the current script.
defined() function checks whether a constant exists.
define() function defines a constant.
constant() function returns the value of a constant.
The connection_status() function returns the current connection status.
The connection_aborted() function checks whether the client is disconnected.
The zip_read() function reads the next file in the opened zip archive.
The zip_open() function opens a ZIP file for reading.
The zip_entry_read() function gets the contents from an open zip archive entry.
The zip_entry_open() function opens a ZIP archive entry for reading.
zip_entry_name() function returns the name of the zip archive entry.
The zip_entry_filesize() function returns the original size of the zip archive entry (before compression).
The zip_entry_compressionmethod() function returns the compression method of the zip archive entry.
The zip_entry_compressedsize() function returns the compressed file size of the zip archive entry.
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 to be called when an unresolved entity name (NDATA) declaration is encountered.
The xml_set_processing_instruction_handler() function specifies the function to be called when the parser finds a processing instruction in the XML document.
The xml_set_object() function allows using XML parsers with objects.
The xml_set_notation_decl_handler() function specifies the function that is called when the parser finds a symbol declaration in the XML document.
The xml_set_external_entity_ref_handler() function specifies the function to be called when the parser finds an external entity in the XML document.
xml_set_element_handler() function establishes the starting and ending element handlers.
The xml_set_default_handler() function establishes the default data handler for the XML parser.
xml_set_character_data_handler() function creates a character data handler.
The xml_parser_set_option() function sets options for the XML parser.
The xml_parser_get_option() function gets option setting information from the XML parser.
xml_parser_free() function frees the XML parser.
xml_parser_create() function creates an XML parser.
The xml_parser_create_ns() function creates an XML parser with namespace support.
xml_parse_into_struct() function parses XML data into an array.
xml_parse() function parses XML documents.
xml_get_error_code() function gets the XML parser error code.
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.
utf8_encode() function encodes ISO-8859-1 string to UTF-8.
utf8_decode() function decodes UTF-8 string to ISO-8859-1.
The wordwrap() function wraps the string according to the specified length.
The vsprintf() function writes the formatted string into a variable.
vprintf() function outputs a formatted string.
The vfprintf() function writes the formatted string to the specified output stream. The
ucwords() function converts the first character of each word in the string to uppercase.
ucfirst() function converts the first character in the string to uppercase. The
trim() function removes whitespace characters and other predefined characters from both ends of a string.
The substr_replace() function replaces part of a string with another string.
The substr_count() function counts the number of times a substring appears in a string.
The substr_compare() function compares two strings from the specified starting length.
The substr() function returns a part of a string.
strtr() function converts specific characters in a string.
strtoupper() function converts a string to uppercase.
strtolower() function converts a string to lowercase.
strtok() function splits a string into smaller strings.
The strstr() function searches for the first occurrence of a string within another string.
strspn() function returns the number of specific characters contained in a string.
strrpos() 函数查找字符串在另一个字符串中最后一次出现的位置。
strripos() 函数查找字符串在另一个字符串中最后一次出现的位置。
strrev() 函数反转字符串。
strrchr() 函数查找字符串在另一个字符串中最后一次出现的位置,并返回从该位置到字符串结尾的所有字符。
strpos() 函数返回字符串在另一个字符串中第一次出现的位置。
strpbrk() 函数在字符串中搜索指定字符中的任意一个。
strncmp() 函数比较两个字符串。
strncasecmp() 函数比较两个字符串。
strnatcmp() 函数使用一种“自然”算法来比较两个字符串。
strnatcasecmp() 函数使用一种“自然”算法来比较两个字符串。
strlen() 函数返回字符串的长度。
stristr() 函数查找字符串在另一个字符串中第一次出现的位置。
stripos() 函数返回字符串在另一个字符串中第一次出现的位置。
stripslashes() 函数删除由 addslashes() 函数添加的反斜杠。
stripcslashes() 函数删除由 addcslashes() 函数添加的反斜杠。
strip_tags() 函数剥去 HTML、XML 以及 PHP 的标签。
strcspn() 函数返回在找到任何指定的字符之前,在字符串查找的字符数。
strcoll() 函数比较两个字符串。
strcmp() 函数比较两个字符串。
strchr() 函数搜索一个字符串在另一个字符串中的第一次出现。
strcasecmp() 函数比较两个字符串。
str_word_count() 函数计算字符串中的单词数。
str_split() 函数把字符串分割到数组中。
str_shuffle() 函数随机地打乱字符串中的所有字符。
str_rot13() 函数对字符串执行 ROT13 编码。
str_replace() 函数使用一个字符串替换字符串中的另一些字符。
str_repeat() 函数把字符串重复指定的次数。
str_pad() 函数把字符串填充为指定的长度。
str_ireplace() 函数使用一个字符串替换字符串中的另一些字符。
sscanf() 函数根据指定的格式解析来自一个字符串的输入。
sprintf() 函数把格式化的字符串写写入一个变量中。
soundex() 函数计算字符串的 soundex 键。
similar_text() 函数计算两个字符串的匹配字符的数目。
sha1_file() 函数计算文件的 SHA-1 散列。
sha1() 函数计算字符串的 SHA-1 散列。
setlocale() 函数设置地区信息(地域信息)。
rtrim() P rtrim() 函数

PHP String 函数
quotemeta() 函数在字符串中某些预定义的字符前添加反斜杠。
quoted_printable_decode() 函数对经过 quoted-printable 编码后的字符串进行解码,返回 8 位的字符串。
printf() 函数输出格式化的字符串。
print() 函数输出一个或多个字符串。
parse_str() 函数把查询字符串解析到变量中。
ord() 函数返回字符串第一个字符的 ASCII 值。
number_format() 函数通过千位分组来格式化数字。
nl2br() 函数在字符串中的每个新行 (\n) 之前插入 HTML 换行符 (
)。
nl_langinfo() 函数返回指定的本地信息。
money_format() 函数把字符串格式化为货币字符串。
metaphone() 函数计算字符串的 metaphone 键。
md5_file() 函数计算文件的 MD5 散列。
md5() 函数计算字符串的 MD5 散列。
ltrim() 函数从字符串左侧删除空格或其他预定义字符。
localeconv() 函数返回包含本地数字及货币信息格式的数组。
levenshtein() 函数返回两个字符串之间的 Levenshtein 距离。
join() 函数把数组元素组合为一个字符串。
implode() 函数把数组元素组合为一个字符串。
htmlspecialchars() 函数把一些预定义的字符转换为 HTML 实体。
html_entity_decode() chars_decode() 函数

PHP String Function
htmlentities() function converts characters into HTML entities.
The html_entity_decode() function converts HTML entities into characters.
The hebrevc() function converts Hebrew text from right-to-left flow to left-to-right flow. It also converts newlines (n) to
. The
hebrev() function converts Hebrew text from right-to-left flow to left-to-right flow.
The get_html_translation_table() function returns the translation table used by the htmlentities() and htmlspecialchars() functions.
The fprintf() function writes a formatted string to the specified output stream (for example: file or database).
The explode() function splits a string into an array.
The echo() function outputs one or more strings.
The crypt() function returns a string encrypted using DES, Blowfish or MD5.
The crc32() function calculates the crc32 polynomial of a string.
The count_chars() function returns information about the characters used in a string.
The convert_uuencode() function uses the uuencode algorithm to encode a string.
The convert_uudecode() function decodes uuencode-encoded strings.
The convert_cyr_string() function converts characters from one Cyrillic character to another.
The chunk_split() function splits a string into a series of smaller parts. The
chr() function returns a character from a specified ASCII value. The
chop() function removes whitespace characters or other predefined characters starting from the end of the string.
The bin2hex() function converts a string of ASCII characters into a hexadecimal value.
The addslashes() function adds a backslash before the specified predefined characters.
The addcslashes() function adds a backslash before the specified character.
The xpath() function runs an XPath query on an XML document.
The simplexml_load_string() function loads an XML string into an object.
The simplexml_load_file() function loads an XML document into an object.
The simplexml_import_dom() function converts DOM nodes into SimpleXMLElement objects. The
registerXPathNamespace() function creates a namespace context for the next XPath query.
The getNamespace() function gets the namespace used in the XML document.
The getName() function gets the name of an XML element from a SimpleXMLElement object.
The getDocNamespaces() function returns the namespaces declared in the XML document from a SimpleXMLElement object.
The children() function gets the child nodes of the specified node. The
attributes() function gets the attributes of a SimpleXML element.
The asXML() function returns an XML document from a SimpleXMLElement object as a string.
The addChild() function adds a child node to the specified XML node.
The addAttribute() function adds an attribute to a SimpleXML element.
__construct() function creates a new SimpleXMLElement object.
The mysql_unbuffered_query() function sends a SQL query to MySQL (without getting/caching the results).
The mysql_thread_id() function returns the ID of the current thread.
The mysql_stat() function returns the current system status 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.
mysql_ping() function Pings a server connection and reconnects 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 MySQL processes.
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 the information of the latest query.
The mysql_get_server_info() function returns the MySQL server information.
The mysql_get_proto_info() function returns MySQL protocol information.
The mysql_get_host_info() function returns the MySQL host information.
The mysql_get_client_info() function returns MySQL client information.
The mysql_free_result() function releases the result memory.
The mysql_field_type() function returns the type of the specified field in the result set.
The mysql_field_table() function returns the table name where the specified field is located.
The mysql_field_seek() function sets the pointer in the result set to the specified field offset.
The mysql_field_name() function gets 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 fetches a row from the result set as a numeric array.
The mysql_fetch_object() function fetches a row as an object from the result set (record set).
The mysql_fetch_lengths() function gets the length of the content 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 fetches a row from the result set as an associative array.
The mysql_fetch_array() function fetches a row from the result set as an associative array, a numeric array, or both
The mysql_error() function returns the text error message generated by the previous MySQL operation.
mysql_errno() 函数返回上一个 MySQL 操作中的错误信息的数字编码。
mysql_db_name() 函数取得 mysql_list_dbs() 调用所返回的数据库名。
mysql_data_seek() 函数移动内部结果的指针。
mysql_connect() 函数打开非持久的 MySQL 连接。
mysql_close() 函数关闭非持久的 MySQL 连接。
mysql_client_encoding() 函数返回当前连接的字符集的名称。
mysql_affected_rows() 函数返回前一次 MySQL 操作所影响的记录行数。
tanh() 函数返回双曲正切。
tan() 函数返回正切。
srand() 函数播下随机数发生器种子。
sqrt() 函数返回一个数的平方根。
sinh() 函数返回一个数的双曲正弦。
sin() 函数返回一个数的正弦。
round() 函数对浮点数进行四舍五入。
rand() 函数返回随机整数。
rad2deg() 函数把弧度数转换为角度数。
pow() 函数返回 x 的 y 次方。
pi() 函数返回圆周率的值。
octdec() 函数把八进制转换为十进制。
mt_srand() 播种 Mersenne Twister 随机数生成器。
mt_rand() 使用 Mersenne Twister 算法返回随机整数。
mt_getrandmax() 显示随机数的最大可能值。
min() 返回最小值。
max() 返回最大值。
log1p() 以返回 log(1 + x),甚至当 x 的值接近零也能计算出准确结果。
log10() 以 10 为底的对数。
log() 返回自然对数。
lcg_value() 组合线性同余发生器。
is_nan() 判断是否为合法数值。
is_infinite() 判断是否为无限值。
is_finite() 函数判断是否为有限值。
hypot() 函数计算一直角三角形的斜边长度。
hexdec() 函数把十六进制转换为十进制。
fmod() 函数显示随机数最大的可能值。
fmod() 函数返回除法的浮点数余数。
floor() 函数向下舍入为最接近的整数。
expm1() 函数返回 exp(x) - 1,甚至当 number 的值接近零也能计算出准确结果。
exp() 函数计算 e 的指数。
deg2rad() 函数将角度转换为弧度。
decoct() 函数把十进制转换为八进制。
dechex() 函数把十进制转换为十六进制。
decbin() 函数把十进制转换为二进制。
cosh() 函数返回一个数的双曲余弦。
cos() 函数返回一个数的余弦。
ceil() 函数向上舍入为最接近的整数。
bindec() 函数把二进制转换为十进制。
base_convert() 函数在任意进制之间转换数字。
atanh() 函数返回一个角度的反双曲正切。
atan() 和 atan2() 和 atan2() 函数

PHP Math 函数
atan() 和 atan2() 和 atan2() 函数

PHP Math function
asinh() function returns the inverse hyperbolic sine of a number.
The asin() function returns the arcsine of different values. The returned result is a radians value between -PI/2 and PI/2.
acosh() function returns the inverse hyperbolic cosine of a number.
The acos() function returns the arc cosine of a number.
abs() function returns the absolute value of a number.
The mail() function allows you to send an email 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 errors from the libxml error buffer.
The libxml_clear_errors() function clears 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 if/where HTTP headers are sent.
The headers_list() function returns a list of sent (or to be sent) response headers.
The header() function sends raw HTTP headers 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 runtime 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 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 files to the server.
The ftp_pasv() function sets passive mode on or off.
The ftp_nlist() function returns the file list in the specified directory.
The ftp_nb_put() function uploads files to the server (non-blocking).
The ftp_nb_get() function gets a file from the FTP server and writes it to a local file (non-blocking).
The ftp_nb_fput() function uploads an open file and saves it as a file on the FTP server (non-blocking).
The ftp_nb_fget() function downloads a file from the FTP server and saves it to a file that has been opened locally (non-blocking).
The ftp_nb_continue() function continuously obtains/sends files.
The ftp_mkdir() function creates a new directory on the FTP server.
The ftp_mdtm() function returns the last modification time of the specified file.
The ftp_login() function logs in to the FTP server.
The ftp_get() function downloads a file from the FTP server.
The ftp_get_option() function returns various option settings for the current FTP connection.
The ftp_fput() function uploads an open file to the FTP server.
The ftp_fget() function downloads a file from the FTP server and saves it to an open file locally.
The ftp_exec() function requests the execution of a program or command 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 the permissions of 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 through the specified filter.
The filter_var_array() function obtains multiple variables and filters them.
The filter_list() function returns an array containing all supported filters.
The filter_input_array() function obtains multiple inputs from outside the script and filters them.
The filter_input() function gets 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 whether a variable of the specified input type exists.
The unlink() function deletes files.
The umask() function changes the current umask.
The touch() function sets the access and modification time of the specified file.
The tmpfile() function creates 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 link.
The stat() function returns information about the file.
The set_file_buffer() function sets the buffer size of the open file.
The rmdir() function deletes empty directories.
The rewind() function rewinds the position of the file pointer to the beginning of the file.
rename() function renames a file or directory.
realpath() function returns the absolute path.
The readlink() function returns the target pointed to by the symbolic link.
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 file path information in the form of an array.
The parse_ini_file() function parses a configuration file and returns the settings in an array.
The move_uploaded_file() function moves the uploaded file to a new location.
mkdir() 函数创建目录。
lstat() 函数返回关于文件或符号连接的信息。
linkinfo() 函数返回连接的信息。
link() 函数建立一个硬连接。
is_writeable() 函数判断指定的文件是否可写。
is_writable() 函数判断指定的文件是否可写。
is_uploaded_file() 函数判断指定的文件是否是通过 HTTP POST 上传的。
is_readable() 函数判断指定文件名是否可读。
is_link() 函数判断指定文件名是否为一个符号连接。
is_file() 函数检查指定的文件名是否是正常的文件。
is_executable() 函数检查指定的文件是否可执行。
is_dir() 函数检查指定的文件是否是目录。
glob() 函数返回匹配指定模式的文件名或目录。
fwrite() 函数写入文件(可安全用于二进制文件)。
ftruncate() 函数把文件截断到指定的长度。
ftell() 函数在打开文件中的当前位置。
fstat() 函数返回关于打开文件的信息。
fseek() 函数在打开的文件中定位。
fscanf() 函数根据指定的格式对来自打开的文件的输入进行解析。
fread() 函数读取文件(可安全用于二进制文件)。
fputs() 函数写入文件(可安全用于二进制文件)。
fputcsv() 函数将行格式化为 CSV 并写入一个打开的文件。
fpassthru() 函数输出文件指针处的所有剩余数据。
fopen() 函数打开文件或者 URL。
fnmatch() 函数根据指定的模式来匹配文件名或字符串。
flock() 函数锁定或释放文件。
filetype() 函数返回指定文件或目录的类型。
filesize() 函数返回指定文件的大小。
fileperms() 函数返回文件或目录的权限。
fileowner() 函数返回文件的所有者。
filemtime() 函数返回文件内容上次的修改时间。
fileinode() 函数返回文件的 inode 编号。
filegroup() 函数返回指定文件的组 ID。
filectime() 函数返回指定文件的上次 inode 修改时间。
fileatime() 函数返回指定文件的上次访问时间。
file_put_contents() 函数把一个字符串写入文件中。
file_get_contents() 函数把整个文件读入一个字符串中。
file_exists() 函数检查文件或目录是否存在。
file() 函数把整个文件读入一个数组中。
fgetss() 函数从打开的文件中读取一行并过滤掉 HTML 和 PHP 标记。
fgets() 函数从文件指针中读取一行。
fgetcsv() 函数从文件指针中读入一行并解析 CSV 字段。
fgetc() 函数从文件指针中读取一个字符。
fflush() 函数将缓冲内容输出到文件。
feof() 函数检测是否已到达文件末尾 (eof)。
fclose() 函数关闭一个打开文件。
diskfreespace() 函数返回目录中的可用空间。该函数是 disk_free_space() 函数的别名。
disk_total_space() 函数返回指定目录的磁盘总大小。
disk_free_space() 函数返回目录中的可用空间
dirname() 函数返回路径中的目录部分。
clearstatcache() 函数拷贝文件。
clearstatcache() 函数清除文件状态缓存。
chown() 函数改变指定文件的所有者。
chmod() 函数改变文件模式。
chgrp() 函数改变文件所属的组。
basename() 函数返回路径中的文件名部分。
set_exception_handler() handler() 函数

PHP Error 和 Logging 函数
set_exception_handler() 函数设置用户自定义的异常处理函数。
set_error_handler() 函数设置用户自定义的错误处理函数。
restore_exception_handler() 函数恢复之前的异常处理程序,该程序是由 set_exception_handler() 函数改变的。
restore_error_handler() 函数恢复之前的错误处理程序,该程序是由 set_error_handler() 函数改变的。
error_reporting() 设置 PHP 的报错级别并返回当前级别。
error_log() 函数向服务器错误记录、文件或远程目标发送一个错误。
error_get_last() 函数获取最后发生的错误。
debug_print_backtrace() 函数输出 backtrace。
debug_backtrace() cktrace() 函数

PHP Error 和 Logging 函数
scandir() 函数返回一个数组,其中包含指定路径中的文件和目录。
rewinddir() 函数重置由 opendir() 打开的目录句柄。
readdir() 函数返回由 opendir() 打开的目录句柄中的条目。
opendir() 函数打开一个目录句柄,可由 closedir(),readdir() 和 rewinddir() 使用。
getcwd() 函数返回当前目录。
closedir() 函数关闭由 opendir() 函数打开的目录句柄。
dir() 函数打开一个目录句柄,并返回一个对象。这个对象包含三个方法:read() , rewind() 以及 close()。
chroot() 函数把当前进程的根目录改变为指定的目录。
chdir() 函数把当前的目录改变为指定的目录。
time() 函数返回当前时间的 Unix 时间戳。
strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。
strptime() 函数解析由 strftime() 生成的日期/时间。
strftime() 函数根据区域设置格式化本地时间/日期。
mktime() 函数返回一个日期的 Unix 时间戳。
microtime() 函数返回当前 Unix 时间戳和微秒数。
localtime() 函数返回本地时间(一个数组)。
idate() 函数将本地时间/日期格式化为整数。
gmstrftime() 函数根据本地区域设置格式化 GMT/UTC 时间/日期。
gmmktime() 函数取得 GMT 日期的 UNIX 时间戳。
gmdate() 函数格式化 GMT/UTC 日期/时间。
gettimeofday() 函数返回一个包含当前时间信息的数组。
getdate() 函数取得日期/时间信息。
date() 函数格式化一个本地时间/日期。
date_sunset() 函数返回指定的日期与地点的日落时间。
date_sunrise() 函数返回指定的日期与地点的日出时间。
date_default_timezone_set() 函数设置用在脚本中所有日期/时间函数的默认时区。
date_default_timezone_get() 函数返回脚本中所有日期时间函数所使用的默认时区。
checkdate() 函数验证一个格里高里日期。
UnixToJD() 函数把 Unix 时间戳转换为儒略日计数。
JulianToJD() 函数把儒略历转换为儒略日计数。
JewishToJD() 函数把犹太历法转换为儒略日计数。
JDToUnix() 函数把儒略日计数转换为 Unix 时间戳。
JDToGregorian() lian() 函数

PHP Array 函数
JDToGregorian() wish() 函数

PHP Array 函数
JDToGregorian() 函数把儒略日计数转换为格利高里历法。
JDToFrench() 函数把儒略日计数转换为法国共和国历法。
JDMonthName() 函数返回指定历法的月份字符串。
JDDayOfWeek() 函数返回日期在周几。
GregorianToJD() 函数将格利高里历法转换成为儒略日计数。
FrenchToJD() 函数将法国共和历法转换成为儒略日计数。
easter_days() 函数返回指定年份的复活节与 3 月 21 日之间的天数。
easter_date() 函数返回指定年份的复活节午夜的 Unix 时间戳。
cal_to_jd() 函数把指定的日期转换为儒略日计数。
cal_info() 函数返回一个数组,其中包含了关于给定历法的信息。
cal_from_jd() 函数把儒略日计数转换为指定历法的日期。
cal_days_in_month() 函数针对指定的年份和日历,返回一个月中的天数。
usort() 函数使用用户自定义的函数对数组排序。
uksort() 函数使用用户自定义的比较函数按照键名对数组排序,并保持索引关系。
uasort() 函数使用用户自定义的比较函数对数组排序,并保持索引关联(不为元素分配新的键)。
sort() 函数按升序对给定数组的值排序。
sizeof() 函数计算数组中的单元数目或对象中的属性个数。
shuffle() 函数把数组中的元素按随机顺序重新排列。
rsort() 函数对数组的元素按照键值进行逆向排序。与 arsort() 的功能基本相同。
reset() 函数把数组的内部指针指向第一个元素,并返回这个元素的值。
range() 函数创建并返回一个包含指定范围的元素的数组。
prev() HP prev() 函数

PHP Array 函数
pos() 函数是 current() 函数 的别名。它可返回数组中当前元素的值。
next() 函数把指向当前元素的指针移动到下一个元素的位置,并返回当前元素的值。
natsort() 函数用自然顺序算法对给定数组中的元素排序。
natcasesort() 函数用不区分大小写的自然顺序算法对给定数组中的元素排序。
list() 函数用数组中的元素为一组变量赋值。
ksort() 函数按照键名对数组排序,为数组值保留原来的键。
krsort() 函数将数组按照键逆向排序,为数组值保留原来的键。
key() 函数返回数组内部指针当前指向元素的键名。
in_array() 函数在数组中搜索给定的值。
extract() extract() 函数

PHP Array 函数
end() 函数将数组内部指针指向最后一个元素,并返回该元素的值(如果成功)。
each() 函数生成一个由数组当前内部指针所指向的元素的键名和键值组成的数组,并把内部指针向前移动。
current() 函数返回数组中的当前元素(单元)。
count() 函数计算数组中的单元数目或对象中的属性个数。
compact() 函数创建一个由参数所带变量组成的数组。如果参数中存在数组,该数组中变量的值也会被获取。
asort() 函数对数组进行排序并保持索引关系。主要用于对那些单元顺序很重要的结合数组进行排序。
arsort() 函数对数组进行逆向排序并保持索引关系。主要用于对那些单元顺序很重要的结合数组进行排序。
array_walk_recursive() cursive() 函数

PHP Array Functions
array_walk() function applies a callback function to each element in the array. Returns TRUE if successful, FALSE otherwise.
array_values() function returns an array containing all key values ​​in the given array, but does not retain the key names.
The array_unshift() function inserts one or more elements at the beginning of the array.
array_unique() function removes duplicate values ​​from an array and returns the resulting array.
The array_uintersect_assoc() function calculates the intersection of arrays with index checking and uses a callback function to compare the data.
The array_uintersect() function calculates the intersection of arrays and uses a callback function to compare the data.
The array_udiff_uassoc() function returns the part that exists in the array1 array but does not exist in other arrays. The key names in the returned array remain unchanged.
The array_udiff_assoc() function returns the part that exists in array1 but does not exist in other arrays.
The array_udiff() function returns an array that includes all values ​​in the compared array but not in any other parameter array, and the key names remain unchanged.
array_sum() function returns the sum of all values ​​in the array.
The array_splice() function is similar to the array_slice() function, selecting a range of elements in an array, but instead of returning them, it deletes them and replaces them with other values.
The array_slice() function removes a segment of value from the array based on conditions and returns it.
array_shift() function deletes the first element in the array and returns the value of the deleted element.
The array_search() function is the same as in_array(), searching for a key value in the array. If the value is found, the key of the matching element is returned. If not found, returns false.
array_reverse() function reverses the order of elements in the original array, creates a new array and returns it. If the second parameter is specified as true, the element's key name remains unchanged, otherwise the key name is lost. The
array_reduce() function uses a callback function to iteratively reduce an array to a single value. If a third argument is specified, it will be treated as the first value in the array, or as the final return value if the array is empty.
The array_rand() function randomly selects one or more elements from the array and returns it. The
array_push() function adds one or more elements (push) to the end of the array of the first parameter, and then returns the length of the new array.
array_product() function calculates and returns the product of all values ​​in an array.
array_pop() function deletes the last element in the array.
array_pad() function inserts a specified number of elements with a specified value into an array.
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 the values ​​in one array are appended to the previous array. and returns the resulting array.
The array_merge() function merges two or more arrays into one array.
The array_map() function returns the array after the user-defined function is applied. The callback function should accept the same number of arguments as the number of arrays passed to the array_map() function.
The array_keys() function returns a new array containing all the keys in the array.
The array_key_exists() function determines whether the specified key exists in an array. If the key exists, it returns true, otherwise it returns false.
The array_intersect_ukey() function uses a callback function to compare key names to calculate the intersection of arrays.
The array_intersect_uassoc() function uses a user-defined callback function to calculate the intersection of arrays and uses the callback function to compare the indices.
The array_intersect_key() function calculates the intersection of arrays using key name comparison.
The array_intersect_assoc() function returns the intersection array of two or more arrays.
The array_intersect() function returns the intersection array of two or more arrays.
The array_flip() function returns a reversed array. If the same value appears multiple times, the last key name will be used as its value, and all other key names will be lost. The
array_filter() function uses a callback function to filter the elements in the array. If the custom filter function returns true, the current value of the operated array will be included in the returned result array, and the result will be formed into a new array. If the original array is an associative array, the key names remain unchanged.
The array_fill() function fills the array with the given value. The returned array has number elements and the value is value. The returned array is numerically indexed, starting at the start position and increasing. If number is 0 or less than 0, an error occurs.
array_diff_ukey() returns an array containing the values ​​of all keys that appear in array1 but do not appear in any other parameter array. Note that the relationship remains unchanged. Unlike array_diff(), the comparison is based on key names rather than values.
The array_diff_uassoc() function uses a user-defined callback function to do index checking to calculate the difference between two or more arrays. Returns an array containing the values ​​in array1 but not in any of the other argument arrays.
The array_diff_key() function returns an array containing all keys that are in the compared array but are not in any other argument array.
The array_diff_assoc() function returns the difference array of two arrays.This array contains all keys and values ​​that are in the array being compared, but are not in any of the other argument arrays.
The array_diff() function returns the difference array of two arrays. This array contains all keys that are in the array being compared, but are not in any of the other argument arrays.
The array_count_values() function is used to count the number of occurrences of all values ​​in the 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 new array chunks.
The array_change_key_case() function converts all KEYs in the array to uppercase or lowercase.
array() creates an array, with keys and values. If the key is omitted when specifying the array, an integer key is generated that starts at 0 and increments by 1.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327426.htmlTechArticleMany PHP seniors have written PHP encyclopedias, but after reading them, I found that those so-called "encyclopedias" are not complete at all. There are even fewer functions than the list I compiled, and it is even titled "Encyclopedia"...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn