PHP 手册
后退 | 附录 B. 从 PHP 4 移植到 PHP 5 | 前进

# 新函数

PHP 5 有了些新函数。下面是列表：

Arrays:

- array_combine() - 用一个数组作为键名，另一个数组作为值创建一个新数组

- array_diff_uassoc() - 计算数组的差别，并用用户提供的回调函数作附加的索引检查

- array_udiff() - 用回调函数比较数据来计算数组的差别

- array_udiff_assoc() - 计算数组的差别并作附加的索引检查。用回调函数来比较数据

- array_udiff_uassoc() - 计算数组的差别并作附加的索引检查。数据的比较和索引检查都用回调函数来完成

- array_walk_recursive() - 对数组的每个成员递归使用用户函数

- array_uintersect_assoc() - 计算数组的交集并作附加的索引检查。用回调函数来比较数据

- array_uintersect_uassoc() - 计算数组的交集并作附加的索引检查。数据和索引都用回调函数来比较

- array_uintersect() - 计算数组的交集。用回调函数来比较数据

InterBase:

- ibase_affected_rows() - 返回前一个查询影响到的行的数目

- ibase_backup() - 在服务管理器中发起一个后台任务并立即返回

- ibase_commit_ret() - 提交一个事务但不关闭

- ibase_db_info() - 请求有关数据库的统计信息

- ibase_drop_db() - 删除一个数据库

- ibase_errcode() - 返回一个错误代码

- ibase_free_event_handler() - 取消一个已注册的事件句柄

- ibase_gen_id() - 递增指定的发生器并返回其新值

- ibase_maintain_db() - 在数据库服务器上执行一条维护命令

- ibase_name_result() - 给结果集指定一个名字

- ibase_num_params() - 返回一个准备好的查询的参数数目

- ibase_param_info() - 返回一个准备好的查询的参数信息

- ibase_restore() - 在服务管理器中发起一个还原任务并立即返回

- ibase_rollback_ret() - 回卷一笔事务并保留事务上下文

- ibase_server_info() - 请求有关数据库服务器的统计信息

- ibase_service_attach() - 连接到服务管理器

- ibase_service_detach() - 从服务管理器断开

- ibase_set_event_handler() - 注册一个当事件发布时要调用的回调函数

- ibase_wait_event() - 等待数据库发布一条事件

iconv:

- iconv_mime_decode() - 解码 MIME 头信息字段

- iconv_mime_decode_headers() - 一次解码多个 MIME 头信息字段

- iconv_mime_encode() - 压缩 MIME 头信息字段

- iconv_strlen() - 返回字符串中的字符计数

- iconv_strpos() - 在堆栈中找到第一个出现的子串位置

- iconv_strrpos() - 在堆栈中指定的范围内找到最后一个出现的子串位置

- iconv_substr() - 从字符串中取出一部分

Streams:

- stream_copy_to_stream() - Copies data from one stream to another

- stream_get_line() - Gets line from stream resource up to a given delimiter

- stream_socket_accept() - Accept a connection on a socket created by stream_socket_server()

- stream_socket_client() - Open Internet or Unix domain socket connection

- stream_socket_get_name() - Retrieve the name of the local or remote sockets

- stream_socket_recvfrom() - Receives data from a socket, connected or not

- stream_socket_sendto() - Sends a message to a socket, whether it is connected or not

- stream_socket_server() - Create an Internet or Unix domain server socket

Date and time related:

- idate() - Format a local time/date as integer

- date_sunset() - Time of sunset for a given day and location

- date_sunrise() - Time of sunrise for a given day and location

- time_nanosleep() - Delay for a number of seconds and nano seconds

Strings:

- str_split() - Convert a string to an array

- strpbrk() - Search a string for any of a set of characters

- substr_compare() - Binary safe optionally case insensitive comparison of two strings from an offset, up to length characters

Other:

- convert_uudecode() - decode a uuencoded string

- convert_uuencode() - uuencode a string

- curl_copy_handle() - Copy a cURL handle along with all of it's preferences

- dba_key_split() - Splits a key in string representation into array representation

- dbase_get_header_info() - Get the header info of a dBase database

- dbx_fetch_row() - Fetches rows from a query-result that had the DBX_RESULT_UNBUFFERED flag set

- fbsql_set_password() - Change the password for a given user

- file_put_contents() - Write a string to a file

- ftp_alloc() - Allocates space for a file to be uploaded

- get_declared_interfaces() - Returns an array of all declared interfaces

- get_headers() - Fetches all the headers sent by the server in response to a HTTP request

- headers_list() - Returns a list of response headers sent (or ready to send)

- http_build_query() - Generate URL-encoded query string

- image_type_to_extension() - Get file extension for image-type returned by getimagesize(), exif_read_data(), exif_thumbnail(), exif_imagetype()

- imagefilter() - Applies Filter an image using a custom angle

- imap_getacl() - Gets the ACL for a given mailbox

- ldap_sasl_bind() - Bind to LDAP directory using SASL

- mb_list_encodings() - Returns an array of all supported encodings

- pcntl_getpriority() - Get the priority of any process

- pcntl_wait() - Waits on or returns the status of a forked child as defined by the waitpid() system call

- pg_version() - Returns an array with client, protocol and server version (when available)

- php_check_syntax() - Check the syntax of the specified file

- php_strip_whitespace() - Return source with stripped comments and whitespace

- proc_nice() - Change the priority of the current process

- pspell_config_data_dir() - Change location of language data files

- pspell_config_dict_dir() - Change location of the main word list

- setrawcookie() - Send a cookie with no url encoding of the value

- snmp_read_mib() - Reads and parses a MIB file into the active MIB tree

- sqlite_fetch_column_types() - Return an array of column types from a particular table

> 注: The Tidy extension has also changed its API completely.

后退 | 起点 | 前进
移植配置文件 | 上一级 | 新指令