PHP各类别常用函数

来源:互联网 发布:皮皮四川麻将源码 编辑:程序博客网 时间:2024/06/07 04:05

              PHP各类别常用函数

字符串函数(important)

addcslashes – 像C语言一样使用反斜线转义字符串中的字符

addslashes -- 使用反斜线引用字符串

bin2hex --  将二进制数据转换成十六进制表示

chop -- rtrim() 的别名函数

★★chr -- 返回相对应于ascii 码值所指定的单个字符。

chunk_split -- 将字符串分割成小块

convert_cyr_string --  将字符由一种 Cyrillic 字符转换成另一种

convert_uudecode --  Decode auuencoded string

convert_uuencode --  Uuencode astring

count_chars --  返回字符串所用字符的信息

crc32 -- 计算一个字符串的 crc32 多项式

crypt – 将字符串用DES编码加密

★★★★★echo – 输出一个或者是多个字符串

★★★★★explode -- 使用一个字符串分割另一个字符串

fprintf – 格式化一个字符串并输出

get_html_translation_table -- Returns the translation table used byhtmlspecialchars() andhtmlentities()

hebrev --  Convert logical Hebrewtext to visual text

hebrevc --  Convert logicalHebrew text to visual text with newline conversion

★★★html_entity_decode – 将所有的HTML实体转换成对应的字符

★★★htmlentities – 将所有的字符转换成HTML实体

★★★htmlspecialchars_decode --  将特定的HTML实体转换为相应的字符

★★★htmlspecialchars -- 将特定的字符转换成HTML实体

★★★★★implode – 将一个数组的所有元素连接成一个字符串

join -- implode()函数的别名

levenshtein --  CalculateLevenshtein distance between two strings

localeconv -- Get numericformatting information

★★★★★ltrim --  去除一个字符串左边的空白(或者是其他的字符)

md5_file – 将一个给定的文件用MD5编码

★★★★★md5 --  将一个给定的字符串用MD5编码

metaphone -- Calculate themetaphone key of a string

money_format – 将一个数字按照货币的格式进行格式化nl_langinfo --  Query languageand locale information

nl2br --  在字符串中插入HTML换行标签。

number_format -- Format a numberwith grouped thousands

★★ord – 返回一个字符的ASCII值

parse_str -- 解析字符串变量

★★★★print – 输出一个字符串

★★★★printf – 格式化并输出该字符串

quoted_printable_decode -- Convert a quoted-printable string to an 8 bit string

quotemeta -- Quote metacharacters

★★★★★rtrim -- 去除一个字符串右边的空白(或者是其他的字符)

setlocale -- Set localeinformation

sha1_file – 将一个文件用SHA1进行编码(加密)

sha1 -- 将一个字符串用SHA1进行编码(加密)

similar_text -- 计算两个字符串之间的相似性

soundex --计算一个字符串的soundexkey

sprintf – 返回一个格式化后的字符串

sscanf --  Parses input from a stringaccording to a format

str_ireplace --  Case-insensitiveversion ofstr_replace().

str_pad --  Pad a string to acertain length with another string

str_repeat -- 重复字符串

str_replace – 替换指定的字符串

str_rot13 -- Perform the rot13 transformon a string

str_shuffle -- Randomly shufflesa string

★★★★★str_split --  将一个字符串转换成一个数组

★★★str_word_count --  返回一个字符串中单词的个数

strcasecmp --  Binary safecase-insensitive string comparison

strchr -- strstr() 的别名

strcmp – 字符串比较(二进制字符串比较)

strcoll -- Locale based stringcomparison

strcspn --  Find length ofinitial segment not matching mask

★★★★★strip_tags – 将一个字符串中的HTML和PHP标记去除

stripcslashes --  去除使用像C语言方式添加的反斜杠。

★★★★★stripos --  Find position offirst occurrence of a case-insensitive string在字符串中不区分大小写的查找字符(或者字符串)第一次出现的位置

stripslashes -- 去除使用函数addslashes()添加的反斜杠。

stristr --  Case-insensitivestrstr()

★★★★★strlen –取得字符串的长度

strnatcasecmp --  Caseinsensitive string comparisons using a "natural order" algorithm

strnatcmp --  String comparisonsusing a "natural order" algorithm

★★★★strncasecmp --  区分大小写比较两个字符串。

 

strncmp --  Binary safe stringcomparison of the first n characters

strpbrk --  Search a string forany of a set of characters

strpos --  查找一个字符在一个字符串中第一次出现的位置。

★★★★★strrchr – 返回从某字符最后一次出现的位置开始一直到字符串结束的子串。

 

★★★strrev – 将字符串颠倒输出

★★★★★strripos -- 返回某字符在字符串中最后一次出现的位置(不区分大小写)。

★★★★★strrpos --  返回某字符在字符串中最后一次出现的位置(区分大小写)。

strspn --  Find length of initialsegment matching mask

★★★★★strstr –  返回从某字符第一次出现的位置开始一直到字符串结束的子串(包含该字符)。

strtok -- Tokenize string

★★★strtolower –将字符串所有字符转换为小写 

★★★strtoupper – 将字符串所有字符转换为大写

strtr -- Translate certaincharacters

substr_compare --  Binary safeoptionally case insensitive comparison of 2 strings from an offset, up tolength characters

★★★substr_count –计算子串出现的次数(区分大小写)

substr_replace – 字串替换

★★★★★substr – 返回指定位置的字串

★★★★★trim – 去掉字符串左右两边的空白(或者其他字符)

★★★ucfirst – 使一个字符串的第一个字符大写

★★★ucwords --  将一个字符串的每个单词的第一个字母大写

vfprintf -- Write a formattedstring to a stream

vprintf – 输出一个格式化后的字符串

vsprintf – 返回一个格式化后的字符串

★★★wordwrap --  使字符串在指定位置换行

例子:

数组函数(important)

array_change_key_case -- 返回字符串键名全为小写或大写的数组

array_chunk -- 将一个数组分割成多个

array_combine --  创建一个数组,用一个数组的值作为其键名,另一个数组的值作为其值

array_count_values -- 统计数组中所有的值出现的次数

array_diff_assoc -- 带索引检查计算数组的差集

array_diff_key -- 使用键名比较计算数组的差集

array_diff_uassoc -- 用用户提供的回调函数做索引检查来计算数组的差集

array_diff_ukey -- 用回调函数对键名比较计算数组的差集

array_diff -- 计算数组的差集

array_fill -- 用给定的值填充数组

array_filter --  用回调函数过滤数组中的单元

array_flip -- 交换数组中的键和值

array_intersect_assoc -- 带索引检查计算数组的交集

array_intersect_key -- 使用键名比较计算数组的交集

array_intersect_uassoc -- 带索引检查计算数组的交集,用回调函数比较索引

array_intersect_ukey -- 用回调函数比较键名来计算数组的交集

array_intersect -- 计算数组的交集

array_key_exists -- 检查给定的键名或索引是否存在于数组中

array_keys -- 返回数组中所有的键名

array_map --  将回调函数作用到给定数组的单元上

array_merge_recursive -- 递归地合并一个或多个数组

★★★★★array_merge -- 合并一个或多个数组

array_multisort -- 对多个数组或多维数组进行排序

array_pad --  用值将数组填补到指定长度

★★★★★array_pop -- 将数组最后一个单元弹出(出栈)

array_product -- 计算数组中所有值的乘积

★★★★★array_push --  将一个或多个单元压入数组的末尾(入栈)

★★★array_rand --  从数组中随机取出一个或多个单元

array_reduce -- 用回调函数迭代地将数组简化为单一的值

★★★array_reverse --  返回一个单元顺序相反的数组

★★★★★array_search --  在数组中搜索给定的值,如果成功则返回相应的键名

array_shift --  将数组开头的单元移出数组

array_slice -- 从数组中取出一段

array_splice --  把数组中的一部分去掉并用其它值取代

★★★array_sum --  计算数组中所有值的和

array_udiff_assoc -- 带索引检查计算数组的差集,用回调函数比较数据

array_udiff_uassoc -- 带索引检查计算数组的差集,用回调函数比较数据和索引

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

array_uintersect_assoc -- 带索引检查计算数组的交集,用回调函数比较数据

array_uintersect_uassoc -- 带索引检查计算数组的交集,用回调函数比较数据和索引

array_uintersect -- 计算数组的交集,用回调函数比较数据

★★★★★array_unique -- 移除数组中重复的值

array_unshift --  在数组开头插入一个或多个单元

array_values -- 返回数组中所有的值

array_walk_recursive -- 对数组中的每个成员递归地应用用户函数

array_walk -- 对数组中的每个成员应用用户函数

★★★★★array --  新建一个数组

★★★★★★★★★★arsort --  对数组进行逆向排序并保持索引关系

★★★★★★★★★★asort -- 对数组进行排序并保持索引关系

compact --  建立一个数组,包括变量名和它们的值

count -- 计算数组中的单元数目或对象中的属性个数

★★★★current -- 返回数组中的当前单元

★★★★★each --  返回数组中当前的键/值对并将数组指针向前移动一步

★★★★end --  将数组的内部指针指向最后一个单元

extract --  从数组中将变量导入到当前的符号表

★★★★★★★★★★in_array -- 检查数组中是否存在某个值

★★★★★key -- 从关联数组中取得键名

★★★★★★★★★★krsort -- 对数组按照键名逆向排序

★★★★★★★★★★ksort -- 对数组按照键名排序

★★★★list --  把数组中的值赋给一些变量

natcasesort --  用“自然排序”算法对数组进行不区分大小写字母的排序

natsort --  用“自然排序”算法对数组排序

★★★★next --  将数组中的内部指针向前移动一位

pos -- current() 的别名

★★★★prev -- 将数组的内部指针倒回一位

range --  建立一个包含指定范围单元的数组

★★★★★reset --  将数组的内部指针指向第一个单元

★★★★★rsort -- 对数组逆向排序

shuffle -- 将数组打乱

★★★★★★★★★★sizeof -- count() 的别名

★★★★★sort -- 对数组排序

uasort --  使用用户自定义的比较函数对数组中的值进行排序并保持索引关联

uksort --  使用用户自定义的比较函数对数组中的键名进行排序

usort --  使用用户自定义的比较函数对数组中的值进行排序

 

日历函数

cal_days_in_month -- Return thenumber of days in a month for a given year and calendar

cal_from_jd -- Converts fromJulian Day Count to a supported calendar

cal_info -- Returns informationabout a particular calendar

cal_to_jd -- Converts from asupported calendar to Julian Day Count

easter_date --  Get Unixtimestamp for midnight on Easter of a given year

easter_days --  Get number ofdays after March 21 on which Easter falls for a given year

FrenchToJD --  Converts a datefrom the French Republican Calendar to a Julian Day Count

GregorianToJD --  Converts aGregorian date to Julian Day Count

JDDayOfWeek -- Returns the day ofthe week

JDMonthName -- Returns a monthname

JDToFrench --  Converts a JulianDay Count to the French Republican Calendar

JDToGregorian -- Converts JulianDay Count to Gregorian date

jdtojewish --  Converts a Julianday count to a Jewish calendar date

JDToJulian --  Converts a JulianDay Count to a Julian Calendar Date

jdtounix -- Convert Julian Day toUnix timestamp

JewishToJD --  Converts a date inthe Jewish Calendar to Julian Day Count

JulianToJD --  Converts a JulianCalendar date to Julian Day Count

unixtojd -- Convert Unixtimestamp to Julian Day

 

时间函数(important)

checkdate -- 验证一个格里高里日期

★★★★★date_default_timezone_get -- 取得一个脚本中所有日期时间函数所使用的默认时区

★★★★★date_default_timezone_set -- 设定用于一个脚本中所有日期时间函数的默认时区

date_sunrise -- 返回给定的日期与地点的日出时间

date_sunset -- 返回给定的日期与地点的日落时间

★★★★★date -- 格式化一个本地时间/日期

getdate -- 取得日期/时间信息

gettimeofday -- 取得当前时间

gmdate -- 格式化一个 GMT/UTC 日期/时间

gmmktime -- 取得 GMT 日期的 UNIX 时间戳

gmstrftime --  根据区域设置格式化 GMT/UTC 时间/日期

idate -- 将本地时间日期格式化为整数

localtime -- 取得本地时间

microtime -- 返回当前 Unix 时间戳和微秒数

mktime -- 取得一个日期的 Unix 时间戳

strftime -- 根据区域设置格式化本地时间/日期

strptime -- 解析由strftime() 生成的日期/时间

strtotime -- 将任何英文文本的日期时间描述解析为 Unix 时间戳

★★★★★time -- 返回当前的 Unix 时间戳

 

MYSQL数据库函数(important)

mysql_affected_rows -- 取得前一次 MySQL 操作所影响的记录行数

mysql_change_user --  改变活动连接中登录的用户

mysql_client_encoding -- 返回字符集的名称

★★★★★mysql_close -- 关闭 MySQL 连接

mysql_connect -- 打开一个到 MySQL 服务器的连接

★★★★★mysql_create_db -- 新建一个 MySQL 数据库

mysql_data_seek -- 移动内部结果的指针

mysql_db_name -- 取得结果数据

mysql_db_query -- 发送一条 MySQL 查询

★★★★★mysql_drop_db -- 丢弃(删除)一个 MySQL 数据库

mysql_errno --  返回上一个 MySQL 操作中的错误信息的数字编码

★★★mysql_error --  返回上一个 MySQL 操作产生的文本错误信息

mysql_escape_string --  转义一个字符串用于 mysql_query

★★★★★mysql_fetch_array --  从结果集中取得一行作为关联数组,或数字数组,或二者兼有

mysql_fetch_assoc --  从结果集中取得一行作为关联数组

★★★★★mysql_fetch_field --  从结果集中取得列信息并作为对象返回

mysql_fetch_lengths --  取得结果集中每个输出的长度

★★★★★mysql_fetch_object -- 从结果集中取得一行作为对象

mysql_fetch_row -- 从结果集中取得一行作为枚举数组

mysql_field_flags --  从结果中取得和指定字段关联的标志

★★★mysql_field_len --  返回指定字段的长度

★★★mysql_field_name --  取得结果中指定字段的字段名

mysql_field_seek --  将结果集中的指针设定为制定的字段偏移量

★★★mysql_field_table --  取得指定字段所在的表名

★★★mysql_field_type --  取得结果集中指定字段的类型

★★★★★mysql_free_result -- 释放结果内存

mysql_get_client_info -- 取得 MySQL 客户端信息

mysql_get_host_info -- 取得 MySQL 主机信息

mysql_get_proto_info -- 取得 MySQL 协议信息

mysql_get_server_info -- 取得 MySQL 服务器信息

mysql_info --  取得最近一条查询的信息

★★★★★mysql_insert_id --  取得上一步 INSERT 操作产生的 ID

★★★★★mysql_list_dbs --  列出 MySQL 服务器中所有的数据库

★★★mysql_list_fields -- 列出 MySQL 结果中的字段

mysql_list_processes -- 列出 MySQL 进程

★★★★★mysql_list_tables -- 列出 MySQL 数据库中的表

★★★mysql_num_fields -- 取得结果集中字段的数目

★★★★★mysql_num_rows -- 取得结果集中行的数目

mysql_pconnect --  打开一个到 MySQL 服务器的持久连接

mysql_ping -- Ping 一个服务器连接,如果没有连接则重新连接

★★★★★mysql_query -- 发送一条 MySQL 查询

mysql_real_escape_string --  转义 SQL 语句中使用的字符串中的特殊字符,并考虑到连接的当前字符集

mysql_result -- 取得结果数据

★★★★★mysql_select_db -- 选择 MySQL 数据库

mysql_stat -- 取得当前系统状态

mysql_tablename -- 取得表名

mysql_thread_id -- 返回当前线程的 ID

mysql_unbuffered_query --  向 MySQL 发送一条 SQL 查询,并不获取和缓存结果的行

 

PostgreSQL数据库函数

pg_affected_rows -- 返回受影响的记录数目

pg_cancel_query --  取消异步查询

pg_client_encoding --  取得客户端编码方式

pg_close -- 关闭一个 PostgreSQL 连接

pg_connect -- 打开一个 PostgreSQL 连接

pg_connection_busy --  获知连接是否为忙

pg_connection_reset --  重置连接(再次连接)

pg_connection_status --  获得连接状态

pg_convert --  将关联的数组值转换为适合 SQL 语句的格式。

pg_copy_from --  根据数组将记录插入表中

pg_copy_to --  将一个表拷贝到数组中

pg_dbname -- 获得数据库名

pg_delete --  删除记录

pg_end_copy -- 与 PostgreSQL 后端同步

pg_escape_bytea --  转义 bytea 类型的二进制数据

pg_escape_string --  转义 text/char 类型的字符串

pg_execute -- Sends a request toexecute a prepared statement with given parameters, and waits for the result.

pg_fetch_all_columns -- Fetchesall rows in a particular result column as an array

pg_fetch_all -- 从结果中提取所有行作为一个数组

pg_fetch_array -- 提取一行作为数组

pg_fetch_assoc -- 提取一行作为关联数组

pg_fetch_object -- 提取一行作为对象

pg_fetch_result -- 从结果资源中返回值

pg_fetch_row -- 提取一行作为枚举数组

pg_field_is_null -- 测试字段是否为NULL

pg_field_name -- 返回字段的名字

pg_field_num -- 返回字段的编号

pg_field_prtlen -- 返回打印出来的长度

pg_field_size --  返回指定字段占用内部存储空间的大小

pg_field_type_oid --  Returns thetype ID (OID) for the corresponding field number

pg_field_type --  返回相应字段的类型名称

pg_free_result -- 释放查询结果占用的内存

pg_get_notify -- Ping 数据库连接

pg_get_pid -- Ping 数据库连接

pg_get_result --  取得异步查询结果

pg_host --  返回和某连接关联的主机名

pg_insert --  将数组插入到表中

pg_last_error -- 得到某连接的最后一条错误信息

pg_last_notice --  返回 PostgreSQL 服务器最新一条公告信息

pg_last_oid -- 返回上一个对象的 oid

pg_lo_close -- 关闭一个大型对象

pg_lo_create -- 新建一个大型对象

pg_lo_export -- 将大型对象导出到文件

pg_lo_import -- 将文件导入为大型对象

pg_lo_open -- 打开一个大型对象

pg_lo_read_all --  读入整个大型对象并直接发送给浏览器

pg_lo_read -- 从大型对象中读入数据

pg_lo_seek --  移动大型对象中的指针

pg_lo_tell --  返回大型对象的当前指针位置

pg_lo_unlink -- 删除一个大型对象

pg_lo_write -- 向大型对象写入数据

pg_meta_data --  获得表的元数据

pg_num_fields -- 返回字段的数目

pg_num_rows -- 返回行的数目

pg_options -- 获得和连接有关的选项

pg_parameter_status -- Looks up acurrent parameter setting of the server.

pg_pconnect -- 打开一个持久的 PostgreSQL 连接

pg_ping -- Ping 数据库连接

pg_port --  返回该连接的端口号

pg_prepare --  Submits a requestto create a prepared statement with the given parameters, and waits forcompletion.

pg_put_line -- 向 PostgreSQL 后端发送以 NULL 结尾的字符串

pg_query_params -- Submits acommand to the server and waits for the result, with the ability to passparameters separately from the SQL command text.

pg_query -- 执行查询

pg_result_error_field -- Returnsan individual field of an error report.

pg_result_error --  获得查询结果的错误信息

pg_result_seek -- 在结果资源中设定内部行偏移量

pg_result_status --  获得查询结果的状态

pg_select --  选择记录

pg_send_execute -- Sends arequest to execute a prepared statement with given parameters, without waitingfor the result(s).

pg_send_prepare -- Sends arequest to create a prepared statement with the given parameters, withoutwaiting for completion.

pg_send_query_params -- Submits acommand and separate parameters to the server without waiting for theresult(s).

pg_send_query --  发送异步查询

pg_set_client_encoding --  设定客户端编码

pg_set_error_verbosity -- Determines the verbosity of messages returned bypg_last_error() andpg_result_error().

pg_trace -- 启动一个 PostgreSQL 连接的追踪功能

pg_transaction_status -- Returnsthe current in-transaction status of the server.

pg_tty --  返回该连接的 tty 号

pg_unescape_bytea --  取消 bytea 类型中的字符串转义

pg_untrace -- 关闭 PostgreSQL 连接的追踪功能

pg_update --  更新表

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

Oracle数据库函数

OCI-Collection->append -- 向 collection 增加单元

OCI-Collection->assign -- 从现有的另一个 collection 向 collection 赋值

OCI-Collection->assignElem -- 给 collection 中的单元赋值

OCI-Collection->free -- 释放关联于 collection 的对象的资源

OCI-Collection->getElem -- 返回单元的值

OCI-Collection->max -- 返回 collection 中单元的最大数目

OCI-Collection->size -- 返回 collection 中的单元数目

OCI-Collection->trim -- 从 collection 尾端开始删除单元

OCI-Lob->append -- Appendsdata from the large object to another large object

OCI-Lob->close -- 关闭 LOB 描述符

OCI-Lob->eof -- Tests forend-of-file on a large object's descriptor

OCI-Lob->erase -- Erases aspecified portion of the internal LOB data

OCI-Lob->export -- 将 LOB 的内容导出到文件中

OCI-Lob->flush -- Flushes/writesbuffer of the LOB to the server

OCI-Lob->free -- 释放与 LOB 描述符所关联的资源

OCI-Lob->getBuffering -- Returnscurrent state of buffering for the large object

OCI-Lob->import -- 将数据从文件导入 LOB

OCI-Lob->load -- 返回大对象的内容

OCI-Lob->read -- Reads part ofthe large object

OCI-Lob->rewind -- Moves theinternal pointer to the beginning of the large object

OCI-Lob->save -- 将数据保存到大对象中

OCI-Lob->seek -- Sets theinternal pointer of the large object

OCI-Lob->setBuffering -- Changescurrent state of buffering for the large object

OCI-Lob->size -- Returns sizeof large object

OCI-Lob->tell -- Returnscurrent position of internal pointer of large object

OCI-Lob->truncate -- Truncateslarge object

OCI-Lob->write -- Writes datato the large object

OCI-Lob->writeTemporary -- 写入一个临时的大对象

oci_bind_by_name -- 绑定一个 PHP 变量到一个 Oracle 位置标志符

oci_cancel -- 取消从游标读取数据

oci_close -- 关闭 Oracle 连接

oci_commit -- 提交未执行的事务处理

oci_connect -- 建立一个到 Oracle 服务器的连接

oci_define_by_name -- 在 SELECT 中使用 PHP 变量作为定义的步骤

oci_error -- 返回上一个错误

oci_execute -- 执行一条语句

oci_fetch_all -- 获取结果数据的所有行到一个数组

oci_fetch_array -- Returns thenext row from the result data as an associative or numeric array, or both

oci_fetch_assoc -- Returns thenext row from the result data as an associative array

oci_fetch_object -- Returns thenext row from the result data as an object

oci_fetch_row -- Returns the nextrow from the result data as a numeric array

oci_fetch -- Fetches the next rowinto result-buffer

oci_field_is_null -- 检查字段是否为NULL

oci_field_name -- 返回字段名

oci_field_precision -- 返回字段精度

oci_field_scale -- 返回字段范围

oci_field_size -- 返回字段大小

oci_field_type_raw -- 返回字段的原始 Oracle 数据类型

oci_field_type -- 返回字段的数据类型

oci_free_statement -- 释放关联于语句或游标的所有资源

oci_internal_debug -- 打开或关闭内部调试输出

oci_lob_copy -- Copies largeobject

oci_lob_is_equal -- Compares twoLOB/FILE locators for equality

oci_new_collection -- 分配新的 collection 对象

oci_new_connect -- 建定一个到 Oracle 服务器的新连接

oci_new_cursor -- 分配并返回一个新的游标(语句句柄)

oci_new_descriptor -- 初始化一个新的空 LOB 或 FILE 描述符

oci_num_fields -- 返回结果列的数目

oci_num_rows -- 返回语句执行后受影响的行数

oci_parse -- 配置 Oracle 语句预备执行

oci_password_change -- 修改 Oracle 用户的密码

oci_pconnect -- 使用一个持久连接连到 Oracle 数据库

oci_result -- 返回所取得行中字段的值

oci_rollback -- 回滚未提交的事务

oci_server_version -- 返回服务器版本信息

oci_set_prefetch -- 设置预提取行数

oci_statement_type -- 返回 OCI 语句的类型

ocibindbyname -- oci_bind_by_name() 的别名

ocicancel -- oci_cancel() 的别名

ocicloselob -- OCI-Lob->close 的别名

ocicollappend -- OCI-Collection->append 的别名

ocicollassign -- OCI-Collection->assign 的别名

ocicollassignelem -- OCI-Collection->assignElem 的别名

ocicollgetelem -- OCI-Collection->getElem 的别名

ocicollmax -- OCI-Collection->max 的别名

ocicollsize -- OCI-Collection->size 的别名

ocicolltrim -- OCI-Collection->trim 的别名

ocicolumnisnull -- oci_field_is_null() 的别名

ocicolumnname -- oci_field_name() 的别名

ocicolumnprecision -- oci_field_precision() 的别名

ocicolumnscale -- oci_field_scale() 的别名

ocicolumnsize -- oci_field_size() 的别名

ocicolumntype -- oci_field_type() 的别名

ocicolumntyperaw -- oci_field_type_raw() 的别名

ocicommit -- oci_commit() 的别名

ocidefinebyname -- oci_define_by_name() 的别名

ocierror -- oci_error() 的别名

ociexecute -- oci_execute() 的别名

ocifetch -- oci_fetch() 的别名

ocifetchinto -- 获取下一行到一个数组

ocifetchistatement -- oci_fetch_all() 的别名

ocifreecollection -- OCI-Collection->free 的别名

ocifreecursor -- oci_free_statement() 的别名

ocifreedesc -- OCI-Lob->free 的别名

ocifreestatement -- oci_free_statement() 的别名

ociinternaldebug -- oci_internal_debug() 的别名

ociloadlob -- OCI-Lob->load 的别名

ocilogoff -- oci_close() 的别名

ocilogon -- oci_connect() 的别名

ocinewcollection -- oci_new_collection() 的别名

ocinewcursor -- oci_new_cursor() 的别名

ocinewscriptor -- oci_new_descriptor() 的别名

ocinlogon -- oci_new_connect() 的别名

ocinumcols -- oci_num_fields() 的别名

ociparse -- oci_parse() 的别名

ociplogon -- oci_pconnect() 的别名

ociresult -- oci_result() 的别名

ocirollback -- oci_rollback() 别名

ocirowcount -- oci_num_rows() 的别名

ocisavelob -- OCI-Lob->save 的别名

ocisavelobfile -- OCI-Lob->import 的别名

ociserverversion -- oci_server_version() 的别名

ocisetprefetch -- oci_set_prefetch() 的别名

ocistatementtype -- oci_statement_type() 的别名

ociwritelobtofile -- OCI-Lob->export 的别名

ociwritetemporarylob -- OCI-Lob->writeTemporary 的别名

 

PHP检测变量函数(important)

debug_zval_dump -- Dumps a stringrepresentation of an internal zend value to output

doubleval -- floatval() 的别名

★★★★★empty -- 检查一个变量是否为空

★★★★★floatval -- 获取变量的浮点值

get_defined_vars --  返回由所有已定义变量所组成的数组

get_resource_type --  返回资源(resource)类型

★★★★★gettype -- 获取变量的类型

import_request_variables -- 将 GET/POST/Cookie 变量导入到全局作用域中

★★★★★intval -- 获取变量的整数值

is_array -- 检测变量是否是数组

is_bool --  检测变量是否是布尔型

is_callable --  检测参数是否为合法的可调用结构

is_double -- is_float() 的别名

is_float -- 检测变量是否是浮点型

is_int -- 检测变量是否是整数

is_integer -- is_int() 的别名

is_long -- is_int() 的别名

is_null --  检测变量是否为NULL

is_numeric --  检测变量是否为数字或数字字符串

is_object -- 检测变量是否是一个对象

is_real -- is_float() 的别名

is_resource --  检测变量是否为资源类型

is_scalar --  检测变量是否是一个标量

is_string -- 检测变量是否是字符串

★★★★★isset -- 检测变量是否设置

★★★★★print_r --  打印关于变量或者数组的易于理解的信息。

serialize --  产生一个可存储的值的表示

★★★★★settype -- 设置变量的类型

★★★★★strval -- 获取变量的字符串值

unserialize --  从已存储的表示中创建 PHP 的值

★★★★★unset -- 释放给定的变量

★★★★★var_dump -- 打印变量的相关信息

var_export -- 输出或返回一个变量的字符串表示

MATH函数

abs -- 绝对值

acos -- 反余弦

acosh -- 反双曲余弦

asin -- 反正弦

asinh -- 反双曲正弦

atan2 -- 两个参数的反正切

atan -- 反正切

atanh -- 反双曲正切

base_convert -- 在任意进制之间转换数字

★★★★bindec -- 二进制转换为十进制

★★★★★ceil -- 进一法取整

cos -- 余弦

cosh -- 双曲余弦

★★★★decbin -- 十进制转换为二进制

★★★★dechex -- 十进制转换为十六进制

★★★★decoct -- 十进制转换为八进制

★★★★★deg2rad --  将角度转换为弧度

exp -- 计算e(自然对数的底)的指数

expm1 --  返回 exp(number) - 1,甚至当 number 的值接近零也能计算出准确结果

★★★★★floor -- 舍去法取整

fmod -- 返回除法的浮点数余数

getrandmax -- 显示随机数最大的可能值

★★★★hexdec -- 十六进制转换为十进制

hypot --  计算一直角三角形的斜边长度

is_finite -- 判断是否为有限值

is_infinite -- 判断是否为无限值

is_nan -- 判断是否为合法数值

lcg_value -- 组合线性同余发生器

log10 -- 以 10 为底的对数

log1p --  返回 log(1 + number),甚至当 number 的值接近零也能计算出准确结果

log -- 自然对数

★★★★★max -- 找出最大值

★★★★★min -- 找出最小值

mt_getrandmax -- 显示随机数的最大可能值

mt_rand -- 生成更好的随机数

mt_srand -- 播下一个更好的随机数发生器种子

★★★★octdec -- 八进制转换为十进制

pi -- 得到圆周率值

pow -- 指数表达式

rad2deg --  将弧度数转换为相应的角度数

★★★★★rand -- 产生一个随机整数

round -- 对浮点数进行四舍五入

sin -- 正弦

sinh -- 双曲正弦

sqrt -- 平方根

srand -- 播下随机数发生器种子

tan -- 正切

tanh -- 双曲正切

BC math 高精度数学函数

 bcadd -- Add two arbitrary precisionnumbers

bccomp -- Compare two arbitraryprecision numbers

bcdiv -- Divide two arbitraryprecision numbers

bcmod --  Get modulus of anarbitrary precision number

bcmul -- Multiply two arbitraryprecision number

bcpow --  Raise an arbitraryprecision number to another

bcpowmod --  Raise an arbitraryprecision number to another, reduced by a specified modulus

bcscale --  Set default scaleparameter for all bc math functions

bcsqrt --  Get the square root ofan arbitrary precision number

bcsub --  Subtract one arbitraryprecision number from another

 

FILE文件处理函数(important)

★★★★★basename -- 返回路径中的文件名部分

chgrp -- 改变文件所属的组

★★★★★chmod -- 改变文件模式

chown -- 改变文件的所有者

clearstatcache -- 清除文件状态缓存

★★★★★copy -- 拷贝文件

delete -- 参见unlink()unset()

★★★★★dirname -- 返回路径中的目录部分

★★★★disk_free_space -- 返回目录中的可用空间

★★★★disk_total_space -- 返回一个目录的磁盘总大小

diskfreespace -- disk_free_space()的别名

★★★★★fclose -- 关闭一个已打开的文件指针

★★★★★★★★★★feof -- 测试文件指针是否到了文件结束的位置

fflush -- 将缓冲内容输出到文件

★★★★★fgetc -- 从文件指针中读取字符

fgetcsv -- 从文件指针中读入一行并解析 CSV 字段

★★★★★★★★★★fgets -- 从文件指针中读取一行

★★★★★fgetss -- 从文件指针中读取一行并过滤掉 HTML 标记

★★★★★file_exists -- 检查文件或目录是否存在

★★★★★★★★★★file_get_contents -- 将整个文件读入一个字符串

file_put_contents -- 将一个字符串写入文件

★★★★★file -- 把整个文件读入一个数组中

fileatime -- 取得文件的上次访问时间

filectime -- 取得文件的 inode 修改时间

filegroup -- 取得文件的组

fileinode -- 取得文件的 inode

filemtime -- 取得文件修改时间

fileowner -- 取得文件的所有者

fileperms -- 取得文件的权限

★★★★★filesize -- 取得文件大小

★★★★★filetype -- 取得文件类型

flock -- 轻便的咨询文件锁定

fnmatch -- 用模式匹配文件名

★★★★★★★★★★fopen -- 打开文件或者 URL

fpassthru -- 输出文件指针处的所有剩余数据

fputcsv -- 将行格式化为 CSV 并写入文件指针

fputs -- fwrite()的别名

★★★★★fread -- 读取文件(可安全用于二进制文件)

fscanf -- 从文件中格式化输入

fseek -- 在文件指针中定位

fstat -- 通过已打开的文件指针取得文件信息

ftell -- 返回文件指针读/写的位置

ftruncate -- 将文件截断到给定的长度

fwrite -- 写入文件(可安全用于二进制文件)

glob -- 寻找与模式匹配的文件路径

★★★★★★★★★★is_dir -- 判断给定文件名是否是一个目录

is_executable -- 判断给定文件名是否可执行

★★★★★★★★★★is_file -- 判断给定文件名是否为一个正常的文件

is_link -- 判断给定文件名是否为一个符号连接

★★★★★is_readable -- 判断给定文件名是否可读

is_uploaded_file -- 判断文件是否是通过 HTTP POST 上传的

★★★★★is_writable -- 判断给定的文件名是否可写

is_writeable -- is_writable()的别名

link -- 建立一个硬连接

linkinfo -- 获取一个连接的信息

lstat -- 给出一个文件或符号连接的信息

★★★★★★★★★★mkdir -- 新建目录

★★★★★★★★★★move_uploaded_file -- 将上传的文件移动到新位置

parse_ini_file -- 解析一个配置文件

★★★★★pathinfo -- 返回文件路径的信息

★★★★★pclose -- 关闭进程文件指针

popen -- 打开进程文件指针

readfile -- 输出一个文件

readlink -- 返回符号连接指向的目标

realpath -- 返回规范化的绝对路径名

★★★★★★★★★★rename -- 重命名一个文件或目录

★★★★★★★★★★rewind -- 倒回文件指针的位置

★★★★★★★★★★rmdir -- 删除目录

set_file_buffer -- stream_set_write_buffer()的别名

stat -- 给出文件的信息

symlink -- 建立符号连接

tempnam -- 建立一个具有唯一文件名的文件

★★★★★tmpfile -- 建立一个临时文件

touch -- 设定文件的访问和修改时间

umask -- 改变当前的 umask

★★★★★★★★★★unlink -- 删除文件

 

目录函数(important)

★★★★★chdir -- 改变目录

chroot -- 改变根目录

dir -- directory 类

★★★★★closedir -- 关闭目录句柄

getcwd -- 取得当前工作目录

★★★★★opendir -- 打开目录句柄

★★★★★readdir -- 从目录句柄中读取条目

★★★★★rewinddir -- 倒回目录句柄

★★★★★scandir -- 列出指定路径中的文件和目录

综合应用实例1删除目录下的所有文件

function DeleteFile($path){

    $dh =opendir($path);

    while (false!== ($filename = readdir($dh))) {

        if($filename == ‘.’ || $filename == ‘..’) {

           continue;

        }

        if (is_dir($path.$filename)) {

           DeleteFile($path.$filename.”\\”);

        } elseif(is_file($path.$filename)) {

           unlink($path.$filename);

        }

    }

   closedir($dh);

   rmdir($path);

}

综合应用实例2:

//删除指定目录下的所有文件以及所有文件夹以及本身***强烈推荐这种方法!!! 

function rmdir_tree($dirname)

//定义一个函数rmdir_tree,要删除的文件名为$dirname

{

 $handle=opendir($dirname);//打开名为$dirname的文件夹

  while($file=readdir($handle)) //跑回圈读取打开的文件夹

  {

    if(($file==".") || ($file=="..")) continue;//继续跑的条件,如果不满足就不跑了

    $fullname=$dirname."/".$file;//完整的文件名(包括路径)

    if(filetype($fullname)=="dir")

     rmdir_tree($fullname);//调用刚刚定义的函数,实现递归

    else

     unlink($fullname);//删除文件

  }

 closedir($handle);//关闭打开了的文件夹

 rmdir($dirname);//删除自身(文件夹)

}

 

综合应用实例3://计算目录的大小

<?php

function directory_size($directory) {

$directorySize=0;

if ($dh = @opendir($directory)) {

while (($filename = readdir ($dh))) {

if ($filename != "." && $filename !="..") {

if (is_file($directory."/".$filename)){

$directorySize +=filesize($directory."/".$filename);

}  

if (is_dir($directory."/".$filename)){

$directorySize +=directory_size($directory."/".$filename);

}

}

}

}

@closedir($dh);

return $directorySize;

}

$directory = "./";

$totalSize = round((directory_size($directory) /1024), 2);

echo "Directory $directory: ".$totalSize."kb.";

?>

 

综合应用实例4:

<?php

function batch_rename_file($base_dir,$postfix,$new_file_name,$num)

{

$handle=opendir($base_dir);

 

$i=$num;

 

$new_name=$new_file_name.$i.$postfix;

 

while($filelist=readdir($handle))

{

if($filelist!= '.' && $$filelist!= '..'){

rename($base_dir.$filelist, $base_dir.$new_name);

$i++;

$new_name=$new_file_name.$i.$postfix;

}

}

closedir($handle);

}

 

batch_rename_file("spring/",".jpg","tangjiali",0);

 

?>

 

正则表达式函数(important)

★★★★★ereg -- 正则表达式匹配

★★★★★eregi -- 不区分大小写的正则表达式匹配

★★★★★ereg_replace -- 替换正则表达式

★★★★★eregi_replace -- 不区分大小写替换正则表达式

★★★★★split -- 用正则表达式将字符串分割到数组中

★★★★★spliti --  用正则表达式不区分大小写将字符串分割到数组中

sql_regcase --  产生用于不区分大小的匹配的正则表达式

 

类和对象函数

call_user_method_array --  调用一个用户方法,同时传递参数数组[已停用]

call_user_method --  调用特定对象的用户方法[已停用]

★★★★★class_exists -- 检查类是否已定义

get_class_methods -- 返回由类的方法名组成的数组

get_class_vars --  返回由类的默认属性组成的数组

get_class -- 返回对象的类名

get_declared_classes -- 返回由已定义类的名字所组成的数组

get_declared_interfaces -- Returns an array of all declared interfaces

get_object_vars -- 返回由对象属性组成的关联数组

get_parent_class -- 返回对象或类的父类名

interface_exists -- Checks if theinterface has been defined

is_a --  如果对象属于该类或该类是此对象的父类则返回TRUE

is_subclass_of --  如果此对象是该类的子类,则返回TRUE

★★★★★method_exists -- 检查类的方法是否存在

property_exists --  Checks if theobject or class has a property

SESSION 函数(important)

session_decode: Session 资料解码。 
★★★★★session_destroy: 结束 session。 
session_encode: Session 资料编码。 
session_id: 存取目前 session 代号。 
★★★★★session_is_registered: 检查变量是否注册。 
session_module_name: 存取目前 session 模块。 
session_name: 存取目前 session 名称。 
★★★★★session_register: 注册新的变量。 
session_save_path: 存取目前 session 路径。 
★★★★★session_start: 初始 session。 
★★★★★session_unregister: 删除已注册变量。 

Perl 兼容正则表达式函数

模式修正符 -- 解说正则表达式模式中使用的修正符

模式语法 -- 解说 Perl 兼容正则表达式的语法

preg_grep --  返回与模式匹配的数组单元

preg_match_all -- 进行全局正则表达式匹配

preg_match -- 进行正则表达式匹配

preg_quote -- 转义正则表达式字符

preg_replace_callback -- 用回调函数执行正则表达式的搜索和替换

preg_replace -- 执行正则表达式的搜索和替换

preg_split -- 用正则表达式分割字符串

 

 

URL函数

★★★★★base64_decode -- 对使用 MIME base64 编码的数据进行解码

★★★★★base64_encode -- 使用 MIME base64 对数据进行编码

get_headers --  Fetches all theheaders sent by the server in response to a HTTP request

get_meta_tags --  从一个文件中提取所有的 meta 标签 content 属性,返回一个数组

http_build_query -- 生成 url-encoded 之后的请求字符串

★★★★★parse_url -- 解析 URL,返回其组成部分

rawurldecode -- 对已编码的 URL 字符串进行解码

rawurlencode -- 按照 RFC 1738 对 URL 进行编码

★★★★★urldecode -- 解码已编码的 URL 字符串

★★★★★urlencode -- 编码 URL 字符串

FTP函数

ftp_alloc -- Allocates space fora file to be uploaded

ftp_cdup -- 切换到当前目录的父目录

ftp_chdir -- 在 FTP 服务器上切换当前目录

ftp_chmod -- Set permissions on afile via FTP

ftp_close -- 关闭一个活动的 FTP 连接

ftp_connect -- 建立一个新的 FTP 连接

ftp_delete -- 删除 FTP 服务器上的一个文件

ftp_exec -- 请求运行一条 FTP 命令

ftp_fget -- 从 FTP 服务器上下载一个文件并保存到本地一个已经打开的文件中

ftp_fput -- 上传一个已经打开的文件到 FTP 服务器

ftp_get_option -- 返回当前 FTP 连接的各种不同的选项设置

ftp_get -- 从 FTP 服务器上下载一个文件

ftp_login -- 登录 FTP 服务器

ftp_mdtm -- 返回指定文件的最后修改时间

ftp_mkdir -- 建立新目录

ftp_nb_continue -- 连续获取/发送文件(non-blocking)

ftp_nb_fget -- Retrieves a filefrom the FTP server and writes it to an open file (non-blocking)

ftp_nb_fput -- Stores a file froman open file to the FTP server (non-blocking)

ftp_nb_get -- 从 FTP 服务器上获取文件并写入本地文件(non-blocking)

ftp_nb_put -- 存储一个文件至 FTP 服务器(non-blocking)

ftp_nlist -- 返回给定目录的文件列表

ftp_pasv -- 返回当前 FTP 被动模式是否打开

ftp_put -- 上传文件到 FTP 服务器

ftp_pwd -- 返回当前目录名

ftp_quit -- ftp_close() 的别名

ftp_raw -- Sends an arbitrarycommand to an FTP server

ftp_rawlist -- 返回指定目录下文件的详细列表

ftp_rename -- 更改 FTP 服务器上指定的文件名

ftp_rmdir -- 删除一个目录

ftp_set_option -- 设置各种 FTP 运行时选项

ftp_site -- 向服务器发送 SITE 命令

ftp_size -- 返回指定文件的大小

ftp_ssl_connect -- Opens anSecure SSL-FTP connection

ftp_systype -- 返回远程 FTP 服务器的系统类型

HTTP函数

★★★★★header -- 发送一个原始 HTTP 标头

headers_list -- 返回已发送(或准备发送)的响应标头的列表

headers_sent -- 检查标头是否已被发送以及在哪里被发送

★★★★★setcookie -- 发送一个 cookie 信息

setrawcookie -- 发送一个其值未经 urlencode 编码的 cookie

 

IMAGE函数

★★★★★gd_info -- 取得当前安装的 GD 库的信息

★★★★★getimagesize -- 取得图像大小

★★★★★image_type_to_extension -- 取得图像类型的文件后缀

image_type_to_mime_type -- 取得 getimagesize,exif_read_data,exif_thumbnail,exif_imagetype 所返回的图像类型的 MIME 类型

★★★★★image2wbmp -- 以 WBMP 格式将图像输出到浏览器或文件

imagealphablending -- 设定图像的混色模式

imageantialias -- 是否使用抗锯齿(antialias)功能

★★★★imagearc -- 画椭圆弧

★★★★imagechar -- 水平地画一个字符

★★★★imagecharup -- 垂直地画一个字符

imagecolorallocate -- 为一幅图像分配颜色

imagecolorallocatealpha -- 为一幅图像分配颜色 + alpha

imagecolorat -- 取得某像素的颜色索引值

imagecolorclosest -- 取得与指定的颜色最接近的颜色的索引值

imagecolorclosestalpha -- 取得与指定的颜色加透明度最接近的颜色

imagecolorclosesthwb --  取得与给定颜色最接近的色度的黑白色的索引

imagecolordeallocate -- 取消图像颜色的分配

imagecolorexact -- 取得指定颜色的索引值

imagecolorexactalpha -- 取得指定的颜色加透明度的索引值

imagecolormatch -- 使一个图像中调色板版本的颜色与真彩色版本更能匹配

imagecolorresolve -- 取得指定颜色的索引值或有可能得到的最接近的替代值

imagecolorresolvealpha --  取得指定颜色 + alpha 的索引值或有可能得到的最接近的替代值

imagecolorset -- 给指定调色板索引设定颜色

imagecolorsforindex -- 取得某索引的颜色

imagecolorstotal -- 取得一幅图像的调色板中颜色的数目

imagecolortransparent -- 将某个颜色定义为透明色

imageconvolution -- 用系数 div 和 offset 申请一个 3x3 的卷积矩阵

imagecopy -- 拷贝图像的一部分

imagecopymerge -- 拷贝并合并图像的一部分

imagecopymergegray -- 用灰度拷贝并合并图像的一部分

imagecopyresampled -- 重采样拷贝部分图像并调整大小

imagecopyresized -- 拷贝部分图像并调整大小

imagecreate -- 新建一个基于调色板的图像

imagecreatefromgd2 -- 从 GD2 文件或 URL 新建一图像

imagecreatefromgd2part -- 从给定的 GD2 文件或 URL 中的部分新建一图像

imagecreatefromgd -- 从 GD 文件或 URL 新建一图像

imagecreatefromgif -- 从 GIF 文件或 URL 新建一图像

imagecreatefromjpeg -- 从 JPEG 文件或 URL 新建一图像

imagecreatefrompng -- 从 PNG 文件或 URL 新建一图像

imagecreatefromstring -- 从字符串中的图像流新建一图像

imagecreatefromwbmp -- 从 WBMP 文件或 URL 新建一图像

imagecreatefromxbm -- 从 XBM 文件或 URL 新建一图像

imagecreatefromxpm -- 从 XPM 文件或 URL 新建一图像

imagecreatetruecolor -- 新建一个真彩色图像

★★★★imagedashedline -- 画一虚线

★★★★imagedestroy -- 销毁一图像

★★★★imageellipse -- 画一个椭圆

★★★★imagefill -- 区域填充

★★★★imagefilledarc -- 画一椭圆弧且填充

★★★★imagefilledellipse -- 画一椭圆并填充

★★★★imagefilledpolygon -- 画一多边形并填充

★★★★imagefilledrectangle -- 画一矩形并填充

imagefilltoborder -- 区域填充到指定颜色的边界为止

imagefilter -- 对图像使用过滤器

★★★★imagefontheight -- 取得字体高度

★★★★imagefontwidth -- 取得字体宽度

imageftbbox -- 给出一个使用 FreeType 2 字体的文本框

★★★★imagefttext -- 使用 FreeType 2 字体将文本写入图像

imagegammacorrect -- 对 GD 图像应用 gamma 修正

★★★★★imagegd2 -- 将 GD2 图像输出到浏览器或文件

★★★★★imagegd -- 将 GD 图像输出到浏览器或文件

imagegif -- 以 GIF 格式将图像输出到浏览器或文件

imageinterlace -- 激活或禁止隔行扫描

imageistruecolor -- 检查图像是否为真彩色图像

★★★★★imagejpeg -- 以 JPEG 格式将图像输出到浏览器或文件

imagelayereffect -- 设定 alpha 混色标志以使用绑定的 libgd 分层效果

★★★★imageline -- 画一条线段

★★★★imageloadfont -- 载入一新字体

imagepalettecopy -- 将调色板从一幅图像拷贝到另一幅

★★★★★imagepng -- 以 PNG 格式将图像输出到浏览器或文件

★★★★imagepolygon -- 画一个多边形

imagepsbbox -- 给出一个使用 PostScript Type1 字体的文本方框

imagepscopyfont -- 拷贝一个已加载的字体以备更改

imagepsencodefont -- 改变字体中的字符编码矢量

imagepsextendfont -- 扩充或精简字体

imagepsfreefont -- 释放一个 PostScript Type 1 字体所占用的内存

imagepsloadfont -- 从文件中加载一个 PostScript Type 1 字体

imagepsslantfont -- 倾斜某字体

imagepstext -- 用 PostScript Type1 字体把文本字符串画在图像上

★★★★imagerectangle -- 画一个矩形

imagerotate -- 用给定角度旋转图像

imagesavealpha -- 设置标记以在保存 PNG 图像时保存完整的 alpha 通道信息(与单一透明色相反)

imagesetbrush -- 设定画线用的画笔图像

imagesetpixel -- 画一个单一像素

★★★★imagesetstyle -- 设定画线的风格

imagesetthickness -- 设定画线的宽度

imagesettile -- 设定用于填充的贴图

★★★★imagestring -- 水平地画一行字符串

★★★★imagestringup -- 垂直地画一行字符串

★★★★★imagesx -- 取得图像宽度

★★★★★imagesy -- 取得图像高度

imagetruecolortopalette -- 将真彩色图像转换为调色板图像

imagettfbbox -- 取得使用 TrueType 字体的文本的范围

★★★★imagettftext -- 用 TrueType 字体向图像写入文本

imagetypes -- 返回当前 PHP 版本所支持的图像类型

★★★★★imagewbmp -- 以 WBMP 格式将图像输出到浏览器或文件

imagexbm -- 将 XBM 图像输出到浏览器或文件

iptcembed -- 将二进制 IPTC 数据嵌入到一幅 JPEG 图像中

iptcparse --  将二进制 IPTChttp://www.iptc.org/ 块解析为单个标记

★★★★jpeg2wbmp -- 将 JPEG 图像文件转换为 WBMP 图像文件

★★★★png2wbmp -- 将 PNG 图像文件转换为 WBMP 图像文件

ZIP函数

zip_close -- Close a ZIP filearchive

zip_entry_close -- Close adirectory entry

zip_entry_compressedsize -- Retrievethe compressed size of a directory entry

zip_entry_compressionmethod -- Retrievethe compression method of a directory entry

zip_entry_filesize -- Retrievethe actual file size of a directory entry

zip_entry_name -- Retrieve thename of a directory entry

zip_entry_open -- Open adirectory entry for reading

zip_entry_read -- Read from anopen directory entry

zip_open -- Open a ZIP filearchive

zip_read -- Read next entry in aZIP file archive

Bzip2 压缩函数

bzclose -- Close a bzip2 file

bzcompress -- Compress a stringinto bzip2 encoded data

bzdecompress -- Decompressesbzip2 encoded data

bzerrno -- Returns a bzip2 errornumber

bzerror --  Returns the bzip2error number and error string in an array

bzerrstr -- Returns a bzip2 errorstring

bzflush -- Force a write of allbuffered data

bzopen -- Opens a bzip2compressed file

bzread -- Binary safe bzip2 fileread

bzwrite -- Binary safe bzip2 filewrite

Gzip函数

gzfile:Read entire gz-file into an array

gzclose -- Close an open gz-filepointer

gzcompress -- Compress a string

gzdeflate -- Deflate a string

gzencode -- Create a gzipcompressed string

gzeof -- Test for end-of-file ona gz-file pointer

gzgetc -- Get character fromgz-file pointer

gzgets -- Get line from filepointer

gzgetss --  Get line from gz-filepointer and strip HTML tags

gzinflate -- Inflate a deflatedstring

gzopen -- Open gz-file

gzpassthru --  Output allremaining data on a gz-file pointer

gzputs -- 别名 gzwrite()

gzread -- Binary-safe gz-fileread

gzrewind -- Rewind the positionof a gz-file pointer

gzseek -- Seek on a gz-filepointer

gztell -- Tell gz-file pointerread/write position

gzuncompress -- Uncompress acompressed string

gzwrite -- Binary-safe gz-filewrite

 

DOM函数

DOMAttr->__construct() -- Creates a new DOMAttr object

DOMAttr->isId() --  Checks ifattribute is a defined ID

DOMCharacterData->appendData() -- Append the string to the end of the character data of the node

DOMCharacterData->deleteData() -- Remove a range of characters from the node

DOMCharacterData->insertData() -- Insert a string at the specified 16-bit unit offset

DOMCharacterData->replaceData() -- Replace a substring within the DOMCharacterData node

DOMCharacterData->substringData() -- Extracts a range of data from the node

DOMComment->__construct() -- Creates a new DOMComment object

DOMDocument->__construct() -- Creates a new DOMDocument object

DOMDocument->createAttribute() -- Createnew attribute

DOMDocument->createAttributeNS() -- Create new attribute node with an associated namespace

DOMDocument->createCDATASection() -- Createnew cdata node

DOMDocument->createComment() -- Createnew comment node

DOMDocument->createDocumentFragment() -- Createnew document fragment

DOMDocument->createElement() -- Createnew element node

DOMDocument->createElementNS() -- Create new element node with an associated namespace

DOMDocument->createEntityReference() -- Createnew entity reference node

DOMDocument->createProcessingInstruction() -- Createsnew PI node

DOMDocument->createTextNode() -- Createnew text node

DOMDocument->getElementById() -- Searchesfor an element with a certain id

DOMDocument->getElementsByTagName() -- Searchesfor all elements with given tag name

DOMDocument->getElementsByTagNameNS() -- Searches for all elements with given tag name in specified namespace

DOMDocument->importNode() -- Importnode into current document

DOMDocument->load() --  LoadXML from a file

DOMDocument->loadHTML() -- Load HTML from a string

DOMDocument->loadHTMLFile() -- Load HTML from a file

DOMDocument->loadXML() -- Load XML from a string

DOMDocument->normalize() -- Normalizes the document

DOMDocument->relaxNGValidate() -- Performs relaxNG validation on the document

DOMDocument->relaxNGValidateSource() -- Performs relaxNG validation on the document

DOMDocument->save() --  Dumpsthe internal XML tree back into a file

DOMDocument->saveHTML() -- Dumps the internal document into a string using HTML formatting

DOMDocument->saveHTMLFile() -- Dumps the internal document into a file using HTML formatting

DOMDocument->saveXML() -- Dumps the internal XML tree back into a string

DOMDocument->schemaValidate() -- Validates a document based on a schema

DOMDocument->schemaValidateSource() -- Validates a document based on a schema

DOMDocument->validate() -- Validates the document based on its DTD

DOMDocument->xinclude() -- Substitutes XIncludes in a DOMDocument Object

DOMElement->__construct() -- Creates a new DOMElement object

DOMElement->getAttribute() -- Returnsvalue of attribute

DOMElement->getAttributeNode() -- Returnsattribute node

DOMElement->getAttributeNodeNS() -- Returns attribute node

DOMElement->getAttributeNS() -- Returnsvalue of attribute

DOMElement->getElementsByTagName() -- Getselements by tagname

DOMElement->getElementsByTagNameNS() -- Getelements by namespaceURI and localName

DOMElement->hasAttribute() -- Checksto see if attribute exists

DOMElement->hasAttributeNS() -- Checks to see if attribute exists

DOMElement->removeAttribute() -- Removesattribute

DOMElement->removeAttributeNode() -- Removesattribute

DOMElement->removeAttributeNS() -- Removesattribute

DOMElement->setAttribute() -- Addsnew attribute

DOMElement->setAttributeNode() -- Addsnew attribute node to element

DOMElement->setAttributeNodeNS() -- Addsnew attribute node to element

DOMElement->setAttributeNS() -- Addsnew attribute

DOMAttr->__construct() -- Creates a new DOMEntityReference object

DOMImplementation->__construct() -- Creates a new DOMImplementation object

DOMImplementation->createDocument() -- Creates a DOMDocument object of the specified type with its document element

DOMImplementation->createDocumentType() -- Creates an empty DOMDocumentType object

DOMImplementation->hasFeature() -- Test if the DOM implementation implements a specific feature

DOMNamedNodeMap->getNamedItem() -- Retrieves a node specified by name

DOMNamedNodeMap->getNamedItemNS() -- Retrieves a node specified by local name and namespace URI

DOMNamedNodeMap->item() -- Retrievesa node specified by index

DOMNode->appendChild() -- Adds new child at the end of the children

DOMNode->cloneNode() -- Clones a node

DOMNode->hasAttributes() -- Checks if node has attributes

DOMNode->hasChildNodes() -- Checks if node has children

DOMNode->insertBefore() -- Adds a new child before a reference node

DOMNode->isSameNode() -- Indicates if two nodes are the same node

DOMNode->isSupported() -- Checks if feature is supported for specified version

DOMNode->lookupNamespaceURI() -- Gets the namespace URI of the node based on the prefix

DOMNode->lookupPrefix() --  Getsthe namespace prefix of the node based on the namespace URI

DOMNode->normalize() -- Normalizes the node

DOMNode->removeChild() -- Removes child from list of children

DOMNode->replaceChild() -- Replaces a child

DOMNodelist->item() -- Retrieves a node specified by index

DOMProcessingInstruction->__construct() -- Creates a new DOMProcessingInstruction object

DOMText->__construct() --  Createsa new DOMText object

DOMText->isWhitespaceInElementContent() -- Indicates whether this text node contains whitespace

DOMText->splitText() -- Breaks this node into two nodes at the specified offset

DOMXPath->__construct() -- Creates a new DOMXPath object

DOMXPath->evaluate() -- Evaluates the given XPath expression and returns a typed result if possible.

DOMXPath->query() -- Evaluates the given XPath expression

DOMXPath->registerNamespace() -- Registers the namespace with the DOMXPath object

dom_import_simplexml --  Gets aDOMElement object from a SimpleXMLElement object

 

win32API函数

w32api_deftype -- 为 w32api_functions 函数定一个类型

w32api_init_dtype --  创建了一个数据类型的实例,并且将函数传入的值填入其中

w32api_invoke_function -- 带有一个参数的执行一个函数,参数传递在函数名的后面

w32api_register_function -- 从函数库中使用 PHP 注册一个函数 function_name

w32api_set_call_method -- 设置调用的方法

COM 和.NET函数

COM -- COM 类

DOTNET -- DOTNET class

VARIANT -- VARIANT 类

com_addref --  增加组件引用计数。[被废弃]

com_create_guid --  Generate aglobally unique identifier (GUID)

com_event_sink --  Connect eventsfrom a COM object to a PHP object

com_get_active_object --  Returnsa handle to an already running instance of a COM object

com_get --  获取 COM 组件的属性值 [被废弃]

com_invoke --  调用 COM 组件的方法。

com_isenum -- 获取一个 IEnumVariant

com_load_typelib -- 装载一个 Typelib

com_load --  创建新的 COM 组件的引用

com_message_pump --  Process COMmessages, sleeping for up to timeoutms milliseconds

com_print_typeinfo --  Print outa PHP class definition for a dispatchable interface

com_propget -- com_get() 的别名

com_propput -- com_set() 的别名

com_propset -- com_set() 的别名

com_release --  减少组件引用计数。[被废弃]

com_set --  给 COM 组件的属性赋值

variant_abs --  Returns theabsolute value of a variant

variant_add --  "Adds"two variant values together and returns the result

variant_and --  performs abitwise AND operation between two variants and returns the result

variant_cast --  Convert avariant into a new variant object of another type

variant_cat --  concatenates twovariant values together and returns the result

variant_cmp --  Compares twovariants

variant_date_from_timestamp -- Returns a variant date representation of a unix timestamp

variant_date_to_timestamp -- Converts a variant date/time value to unix timestamp

variant_div --  Returns theresult from dividing two variants

variant_eqv --  Performs abitwise equivalence on two variants

variant_fix --  Returns theinteger portion ? of a variant

variant_get_type -- Returns thetype of a variant object

variant_idiv --  Convertsvariants to integers and then returns the result from dividing them

variant_imp --  Performs abitwise implication on two variants

variant_int --  Returns theinteger portion of a variant

variant_mod --  Divides twovariants and returns only the remainder

variant_mul --  multiplies thevalues of the two variants and returns the result

variant_neg --  Performs logicalnegation on a variant

variant_not --  Performs bitwisenot negation on a variant

variant_or --  Performs a logicaldisjunction on two variants

variant_pow --  Returns theresult of performing the power function with two variants

variant_round --  Rounds avariant to the specified number of decimal places

variant_set_type --  Convert avariant into another type "in-place"

variant_set --  Assigns a newvalue for a variant object

variant_sub --  subtracts thevalue of the right variant from the left variant value and returns the result

variant_xor --  Performs alogical exclusion on two variants

dotnet_load -- 加载一个 DOTNET 模块

 

APACHE特有函数:

apache_child_terminate -- 在本次请求结束后终止 apache 进程

apache_get_modules -- Get a listof loaded Apache modules

apache_get_version -- FetchApache version

apache_getenv -- Get an Apachesubprocess_env variable

apache_lookup_uri -- 对指定的 URI 执行部分请求并返回所有有关信息

apache_note -- 取得或设置 apache 请求记录

apache_request_headers -- Fetchall HTTP request headers

apache_reset_timeout -- Reset theApache write timer

apache_response_headers -- Fetchall HTTP response headers

apache_setenv -- Set an Apachesubprocess_env variable

ascii2ebcdic -- Translate stringfrom ASCII to EBCDIC

ebcdic2ascii -- Translate stringfrom EBCDIC to ASCII

getallheaders -- Fetch all HTTPrequest headers

virtual -- Perform an Apachesub-request

PDF操作函数

PDF_add_annotation: 加入注释。 
PDF_add_outline: 目前页面加入书签。 
PDF_arc: 绘弧。 
PDF_begin_page: 启始 PDF 文件页面。 
PDF_circle: 绘圆。 
PDF_clip: 组合所有向量。 
PDF_close: 关闭 PDF 文件。 
PDF_closepath: 形成封闭的向量形状。 
PDF_closepath_fill_stroke: 形成封闭的向量形状沿向量绘线并填满。 
PDF_closepath_stroke: 形成封闭的向量形状并沿向量绘线。 
PDF_close_image: 关闭图文件。 
PDF_continue_text: 输出文字。 
PDF_curveto: 绘贝氏曲线。 

PDF_endpath: 关闭目前向量。 
PDF_end_page: 关闭 PDF 文件页面。 
PDF_execute_image: 放置 PDF 文件中图片到指定位置。 [Page]
PDF_fill: 填满目前的向量。 
PDF_fill_stroke: 填满目前的向量并沿向量绘线。 
PDF_get_info: 返回文件信息。 
PDF_lineto: 绘直线。 
PDF_moveto: 配置处理的坐标点。 
PDF_open: 建立新的 PDF 文件。 
PDF_open_gif: 打开 GIF 图文件。 
PDF_open_jpeg: 打开 JPEG 图文件。 
PDF_open_memory_image: 打开内存图文件。 
PDF_place_image: 放置图片到 PDF 文件指定位置。 
PDF_put_image: 放置图片到 PDF 文件。 
PDF_rect: 绘长方形。 
PDF_restore: 还原环境变量。 
PDF_rotate: 旋转类。 
PDF_save: 储存环境变量。 
PDF_scale: 缩放类。 
PDF_setdash: 配置虚线样式。 
PDF_setflat: 配置平滑值。 
PDF_setgray: 指定绘图的颜色为灰阶并填入。 
PDF_setgray_fill: 指定填入的颜色为灰阶。 
PDF_setgray_stroke: 指定绘图的颜色为灰阶。 
PDF_setlinecap: 配置 linecap 参数。 
PDF_setlinejoin: 配置连接参数。 
PDF_setlinewidth: 配置线宽。 
PDF_setmiterlimit: 配置斜边界限。 
PDF_setrgbcolor: 指定绘图的颜色为彩色并填入。 
PDF_setrgbcolor_fill: 指定填入的颜色为彩色。 
PDF_setrgbcolor_stroke: 指定绘图的颜色为彩色。 
PDF_set_char_spacing: 配置字符间距。 
PDF_set_duration: 配置二页的切换时间。 
PDF_set_font: 配置使用的字型及大小。 
PDF_set_horiz_scaling: 配置文字水平间距。 
PDF_set_info_author: 配置文件作者。 
PDF_set_info_creator: 配置建文件者字符串。 
PDF_set_info_keywords: 配置文件的关键字。 
PDF_set_info_subject: 配置文件主题。 
PDF_set_info_title: 配置文件标题。 
PDF_set_leading: 配置行距。 
PDF_set_text_matrix: 配置文字矩阵。 
PDF_set_text_pos: 配置文字位置。 
PDF_set_text_rendering: 配置文字表现方式。 
PDF_set_text_rise: 配置文字高度。 
PDF_set_transition: 配置页的转换。 
PDF_set_word_spacing: 配置字间距。 
PDF_show: 输出字符串到 PDF 文件。 
PDF_show_xy: 输出字符串到指定坐标。 
PDF_stringwidth: 计算字符串的宽度。 
PDF_stroke: 沿向量绘线。 
PDF_translate: 移动原点。
FDF_close: 关闭 FDF 文件。 
FDF_create: 建立新的 FDF 文件。 
FDF_get_file: 取得 /F 键的值。 
FDF_get_status: 取得 /STATUS 键的值。 [Page]
FDF_get_value: 取得字段的值。 
FDF_next_field_name: 下一字段的名称。 
FDF_open: 打开 FDF 文件。 
FDF_save: 将 FDF 文件存文件。 
FDF_set_ap: 配置显示字段。 
FDF_set_file: 配置 /F 键。 
FDF_set_status: 配置 /STATUS 键。 
FDF_set_value: 配置字段的值。

XML语法解析函数

xml_error_string: 取得 XML 错误字符串。 
xml_get_current_byte_index: 取得目前解析为第几个位组。 
xml_get_current_column_number: 获知目前解析的第几字段。 
xml_get_current_line_number: 取得目前解析的行号。 
xml_get_error_code: 取得 XML 错误码。 
xml_parse: 解析 XML 文件。 
xml_parser_create: 初始 XML 解析器。 
xml_parser_free: 释放解析占用的内存。 
xml_parser_get_option: 取得解析使用的选项。 
xml_parser_set_option: 配置解析使用的选项。 
xml_set_character_data_handler: 建立字符资料标头。 
xml_set_default_handler: 建立默认标头。 
xml_set_element_handler: 配置元素的标头。 
xml_set_external_entity_ref_handler: 配置外部实体参引的标头。 
xml_set_notation_decl_handler: 配置记法宣告的标头。 
xml_set_object: 使 XML 解析器用类。 
xml_set_processing_instruction_handler: 建立处理指令标头。 [Page]
xml_set_unparsed_entity_decl_handler: 配置未解析实体宣告的标头。

Simple XML函数

SimpleXMLElement->asXML -- Return a well-formed XML string based on SimpleXML element

SimpleXMLElement->attributes -- Identifies an element's attributes

SimpleXMLElement->children -- Finds children of given node

SimpleXMLElement->xpath -- Runs Xpath query on XML data

simplexml_import_dom --  Get aSimpleXMLElementobject from a DOM node.

simplexml_load_file -- Interprets an XML file into an object

simplexml_load_string -- Interprets a string of XML into an object

 

ODBC函数

//使用odbc函数可以连接到任何类型的数据库。

//需要配置数据库的odbc数据源(需要对应的数据库的odbc驱动)
odbc_autocommit: 开关自动改动功能。 
odbc_binmode: 配置二进位资料处理方式。 
odbc_close: 关闭 ODBC 链接。 
odbc_close_all: 关闭所有 ODBC 链接。 
odbc_commit: 改动 ODBC 数据库。 
odbc_connect: 链接至 ODBC 数据库。 
odbc_cursor: 取得游标名。 
odbc_exec: 执行 SQL 指令。 == odbc_do: 执行 SQL 指令。 
odbc_execute: 执行预置 SQL 指令。 
odbc_fetch_into: 取得返回的指定列。 [Page]
odbc_fetch_row: 取得返回一行。 
odbc_field_len: 取得字段资料长度。 
odbc_field_name: 取得字段名称。 
odbc_field_type: 取得字段资料类型。 


odbc_free_result: 释出返回资料的内存。 
odbc_longreadlen: 配置返回栏的最大值。 
odbc_num_fields: 取得字段的数目。 
odbc_num_rows: 取得返回行的数目。 
odbc_pconnect: 长期链接至 ODBC 数据库。 
odbc_prepare: 预置 SQL 指令。 
odbc_result: 取得返回资料。 
odbc_result_all: 返回 HTML 表格资料。 
odbc_rollback: 撤消当前交易。 
odbc_setoption: 调整 ODBC 配置。 

 

其他有用的函数: (important)

★★★★★Chop: 去除连续空白。

★★★★★connection_timeout: 若超过 PHP 程序执行时间则返回 true。 

★★★★★define: 定义一个常量 

★★★★★dl: 载入 PHP 扩充模块 

★★★★★die: 输出信息并中断 PHP 程序。 

★★★★★exec: 执行外部程序。 
★★★★★exit: 结束 PHP 程序。 

★★★★★function_exists: 检查函数是否已定义。 

★★★★★getenv: 取得系统的环境变量 
★★★★★gethostbyaddr: 根据IP地址返回机器名称。 
★★★★★gethostbyname: 根据域名返回 IP 网址。 

★★★★★mail: 寄出电子邮件。 

★★★★★set_time_limit: 设置该页最久执行时间。

★★★★★sleep(int seconds): 暂停执行(以秒为单位)。 

★★★★★ require_once()--在脚本执行期间包含并运行指定文件。

★★★★★require()语句包含并运行指定文件。

★★★★★include()语句包含并运行指定文件。

★★★★★include_once()语句在脚本执行期间包含并运行指定文件。

0 0