收藏 分享(赏)

PHP常用函数大全(新).doc

上传人:HR专家 文档编号:5243691 上传时间:2019-02-13 格式:DOC 页数:37 大小:840KB
下载 相关 举报
PHP常用函数大全(新).doc_第1页
第1页 / 共37页
PHP常用函数大全(新).doc_第2页
第2页 / 共37页
PHP常用函数大全(新).doc_第3页
第3页 / 共37页
PHP常用函数大全(新).doc_第4页
第4页 / 共37页
PHP常用函数大全(新).doc_第5页
第5页 / 共37页
点击查看更多>>
资源描述

1、PHP 常用函数大全字符串函数(important)addcslashes 像 C 语言一样使用反斜线转义字符串中的字符 addslashes - 使用反斜线引用字符串 bin2hex - 将二进制数据转换成十六进制表示 chop - rtrim() 的别名函数 chr - 返回指定的字符 chunk_split - 将字符串分割成小块 convert_cyr_string - 将字符由一种 Cyrillic 字符转换成另一种 convert_uudecode - Decode a uuencoded string convert_uuencode - Uuencode a string co

2、unt_chars - 返回字符串所用字符的信息 crc32 - 计算一个字符串的 crc32 多项式 crypt 将字符串用 DES 编码加密echo 输出一个或者是多个字符串explode - 使用一个字符串分割另一个字符串 fprintf 格式化一个字符串并输出get_html_translation_table - Returns the translation table used by/ / Array( 0 = Hel 1 = lo 2 = Fri3 = end)print_r($arr1); print_r($arr2);?str_word_count - 返回一个字符串中单词

3、的个数strcasecmp - Binary safe case-insensitive string comparison strcmp 字符串比较(二进制字符串比较) strcoll - Locale based string comparison strcspn - Find length of initial segment not matching mask strip_tags 将一个字符串中的 HTML 和 PHP 标记去除stripcslashes - 去除使用像 C 语言方式添加的反斜杠。string 在字符串中不区分大小写的查找字符(或者字符串)第一次出现的位置strips

4、lashes - 去除使用函数 addslashes()添加的反斜杠。strlen 取得字符串的长度 strnatcasecmp - Case insensitive string comparisons using a “natural order“ algorithm strnatcmp - String comparisons using a “natural order“ algorithm strncasecmp - 区分大小写比较两个字符串。strncmp - Binary safe string comparison of the first n characters strpb

5、rk - Search a string for any of a set of characters strpos - 查找一个字符(或字符串)在一个字符串中第一次出现的位置。Ex:stripos - 查找一个字符(或字符串)在一个字符串中最后一次出现的位置(不区分大小写)。 Ex:strrpos - 查找一个字符(或字符串)在一个字符串中最后一次出现的位置。Ex:strripos - 查找一个字符(或字符串)在一个字符串中最后一次出现的位置(不区分大小写)。 Ex:strstr 取得从一个字符(或字符串)第一次出现的位置开始一直到字符串结束的字串ex:stristr - 取得从某字符(或字

6、符串)第一次出现的位置开始一直到字符串结束的字串(不区分大小写)strchr - strstr() 的别名strrchr 取得从一个字符(或字符串)最后一次出现的位置开始一直字到符串结束的子串(区分大小写)substr 返回指定位置的字串substr_replace 字串替换strrev 将字符串颠倒输出strspn - Find length of initial segment matching maskstrtok - Tokenize string strtolower 将字符串转换为小写 strtoupper 将字符串转换为大写strtr 转换特定的字符 substr_compare

7、 - Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters substr_count 计算子串出现的次数 ucfirst 使一个字符串的第一个字符大写 ucwords - 将一个字符串的每个单词的第一个字母大写vfprintf - Write a formatted string to a stream vprintf 输出一个格式化后的字符串vsprintf 返回一个格式化后的字符串wordwrap - 使字符串在制定位置换行数组函数(im

8、portant)array_change_key_case - 返回字符串键名全为小写或大写的数组 array_chunk - 将一个数组分割成多个 array_combine - 创建一个数组,用一个数组的值作为其键名,另一个数组的值作为其值 array_count_values - 统计数组中所有的值出现的次数 array_diff_assoc - 带索引检查计算数组的差集 array_diff_key - 使用键名比较计算数组的差集 array_diff_uassoc - 用用户提供的回调函数做索引检查来计算数组的差集 array_diff_ukey - 用回调函数对键名比较计算数组的差

9、集 array_diff - 计算数组的差集 array_fill - 用给定的值填充数组 array_filter - 用回调函数过滤数组中的单元 array_flip - 交换数组中的键和值 array_intersect_assoc - 带索引检查计算数组的交集 array_intersect_key - 使用键名比较计算数组的交集 array_intersect_uassoc - 带索引检查计算数组的交集,用回调函数比较索引 array_intersect_ukey - 用回调函数比较键名来计算数组的交集 array_intersect - 计算数组的交集 array_key_exis

10、ts - 检查给定的键名或索引是否存在于数组中 array_keys - 返回数组中所有的键名 array_map - 将回调函数作用到给定数组的单元上 array_merge_recursive - 递归地合并一个或多个数组 array_merge - 合并一个或多个数组 array_multisort - 对多个数组或多维数组进行排序 array_pad - 用值将数组填补到指定长度 array_pop - 将数组最后一个单元弹出(出栈) array_product - 计算数组中所有值的乘积 array_push - 将一个或多个单元压入数组的末尾(入栈) array_rand - 从数

11、组中随机取出一个或多个单元 array_reduce - 用回调函数迭代地将数组简化为单一的值 array_reverse - 返回一个单元顺序相反的数组 array_search - 在数组中搜索给定的值,如果成功则返回相应的键名 array_shift - 将数组开头的单元移出数组 array_slice - 从数组中取出一段 array_splice - 把数组中的一部分去掉并用其它值取代 array_sum - 计算数组中所有值的和 array_udiff_assoc - 带索引检查计算数组的差集,用回调函数比较数据 array_udiff_uassoc - 带索引检查计算数组的差集,

12、用回调函数比较数据和索引 array_udiff - 用回调函数比较数据来计算数组的差集 array_uintersect_assoc - 带索引检查计算数组的交集,用回调函数比较数据 array_uintersect_uassoc - 带索引检查计算数组的交集,用回调函数比较数据和索引 array_uintersect - 计算数组的交集,用回调函数比较数据 array_unique - 移除数组中重复的值 array_unshift - 在数组开头插入一个或多个单元 array_values - 返回数组中所有的值 array_walk_recursive - 对数组中的每个成员递归地应用

13、用户函数 array_walk - 对数组中的每个成员应用用户函数 array - 新建一个数组 arsort - 对数组进行逆向排序并保持索引关系 asort - 对数组进行排序并保持索引关系 compact - 建立一个数组,包括变量名和它们的值 count - 计算数组中的单元数目或对象中的属性个数 =sizeofcurrent - 返回数组中的当前单元 each - 返回数组中当前的键值对并将数组指针向前移动一步 end - 将数组的内部指针指向最后一个单元 extract - 从数组中将变量导入到当前的符号表 in_array - 检查数组中是否存在某个值 key - 从关联数组中取

14、得键名 krsort - 对数组按照键名逆向排序 ksort - 对数组按照键名排序 list - 把数组中的值赋给一些变量 natcasesort - 用“自然排序”算法对数组进行不区分大小写字母的排序 natsort - 用“自然排序”算法对数组排序 next - 将数组中的内部指针向前移动一位 pos - current() 的别名 prev - 将数组的内部指针倒回一位 range - 建立一个包含指定范围单元的数组 reset - 将数组的内部指针指向第一个单元 rsort - 对数组逆向排序 sort - 对数组排序 shuffle - 将数组打乱 sizeof - count()

15、 的别名 uasort - 使用用户自定义的比较函数对数组中的值进行排序并保持索引关联 uksort - 使用用户自定义的比较函数对数组中的键名进行排序 usort - 使用用户自定义的比较函数对数组中的值进行排序日历函数cal_days_in_month - Return the number of days in a month for a given year and calendar cal_from_jd - Converts from Julian Day Count to a supported calendar cal_info - Returns information ab

16、out a particular calendar cal_to_jd - Converts from a supported calendar to Julian Day Count easter_date - Get Unix timestamp for midnight on Easter of a given year easter_days - Get number of days after March 21 on which Easter falls for a given year FrenchToJD - Converts a date from the French Rep

17、ublican Calendar to a Julian Day Count GregorianToJD - Converts a Gregorian date to Julian Day Count JDDayOfWeek - Returns the day of the week JDMonthName - Returns a month name JDToFrench - Converts a Julian Day Count to the French Republican Calendar JDToGregorian - Converts Julian Day Count to Gr

18、egorian date jdtojewish - Converts a Julian day count to a Jewish calendar date JDToJulian - Converts a Julian Day Count to a Julian Calendar Date jdtounix - Convert Julian Day to Unix timestamp JewishToJD - Converts a date in the Jewish Calendar to Julian Day Count JulianToJD - Converts a Julian Ca

19、lendar date to Julian Day Count unixtojd - Convert Unix timestamp to Julian Day时间函数(important)checkdate - 验证一个格里高里日期 date_default_timezone_get - 取得一个脚本中所有日期时间函数所使用的默认时区 date_default_timezone_set - 设定用于一个脚本中所有日期时间函数的默认时区 date_sunrise - 返回给定的日期与地点的日出时间 date_sunset - 返回给定的日期与地点的日落时间 date - 格式化一个本地时间日期

20、getdate - 取得日期时间信息 gettimeofday - 取得当前时间 gmdate - 格式化一个 GMT/UTC 日期时间 gmmktime - 取得 GMT 日期的 UNIX 时间戳 gmstrftime - 根据区域设置格式化 GMT/UTC 时间日期 idate - 将本地时间日期格式化为整数 localtime - 取得本地时间 microtime - 返回当前 Unix 时间戳和微秒数 mktime - 取得一个日期的 Unix 时间戳 strftime - 根据区域设置格式化本地时间日期 strptime - 解析由 strftime() 生成的日期时间 strtot

21、ime - 将任何英文文本的日期时间描述解析为 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 -

22、移动内部结果的指针 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 - 从结果集中取得一行作为

23、关联数组 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_tab

24、le - 取得指定字段所在的表名 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_l

25、ist_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 查询

26、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_canc

27、el_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_dbnam

28、e - 获得数据库名 pg_delete - 删除记录 pg_end_copy - 与 PostgreSQL 后端同步 pg_escape_bytea - 转义 bytea 类型的二进制数据 pg_escape_string - 转义 text/char 类型的字符串 pg_execute - Sends a request to execute a prepared statement with given parameters, and waits for the result. pg_fetch_all_columns - Fetches all rows in a particular

29、 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 - 返回打印出来的长度

30、pg_field_size - 返回指定字段占用内部存储空间的大小 pg_field_type_oid - Returns the type 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_

31、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_

32、lo_tell - 返回大型对象的当前指针位置 pg_lo_unlink - 删除一个大型对象 pg_lo_write - 向大型对象写入数据 pg_meta_data - 获得表的元数据 pg_num_fields - 返回字段的数目 pg_num_rows - 返回行的数目 pg_options - 获得和连接有关的选项 pg_parameter_status - Looks up a current parameter setting of the server. pg_pconnect - 打开一个持久的 PostgreSQL 连接 pg_ping - Ping 数据库连接 pg_po

33、rt - 返回该连接的端口号 pg_prepare - Submits a request to create a prepared statement with the given parameters, and waits for completion. pg_put_line - 向 PostgreSQL 后端发送以 NULL 结尾的字符串 pg_query_params - Submits a command to the server and waits for the result, with the ability to pass parameters separately fr

34、om the SQL command text. pg_query - 执行查询 pg_result_error_field - Returns an individual field of an error report. pg_result_error - 获得查询结果的错误信息 pg_result_seek - 在结果资源中设定内部行偏移量 pg_result_status - 获得查询结果的状态 pg_select - 选择记录 pg_send_execute - Sends a request to execute a prepared statement with given pa

35、rameters, without waiting for the result(s). pg_send_prepare - Sends a request to create a prepared statement with the given parameters, without waiting for completion. pg_send_query_params - Submits a command and separate parameters to the server without waiting for the result(s). pg_send_query - 发

36、送异步查询 pg_set_client_encoding - 设定客户端编码 pg_set_error_verbosity - Determines the verbosity of messages returned by pg_last_error() and pg_result_error(). pg_trace - 启动一个 PostgreSQL 连接的追踪功能 pg_transaction_status - Returns the current in-transaction status of the server. pg_tty - 返回该连接的 tty 号 pg_unescap

37、e_bytea - 取消 bytea 类型中的字符串转义 pg_untrace - 关闭 PostgreSQL 连接的追踪功能 pg_update - 更新表 pg_version - Returns an array with client, protocol and server version (when available) Oracle 数据库函数OCI-Collection-append - 向 collection 增加单元 OCI-Collection-assign - 从现有的另一个 collection 向 collection 赋值 OCI-Collection-assi

38、gnElem - 给 collection 中的单元赋值 OCI-Collection-free - 释放关联于 collection 的对象的资源 OCI-Collection-getElem - 返回单元的值 OCI-Collection-max - 返回 collection 中单元的最大数目 OCI-Collection-size - 返回 collection 中的单元数目 OCI-Collection-trim - 从 collection 尾端开始删除单元 OCI-Lob-append - Appends data from the large object to another

39、 large object OCI-Lob-close - 关闭 LOB 描述符 OCI-Lob-eof - Tests for end-of-file on a large objects descriptor OCI-Lob-erase - Erases a specified portion of the internal LOB data OCI-Lob-export - 将 LOB 的内容导出到文件中 OCI-Lob-flush - Flushes/writes buffer of the LOB to the server OCI-Lob-free - 释放与 LOB 描述符所关联

40、的资源 OCI-Lob-getBuffering - Returns current state of buffering for the large object OCI-Lob-import - 将数据从文件导入 LOB OCI-Lob-load - 返回大对象的内容 OCI-Lob-read - Reads part of the large object OCI-Lob-rewind - Moves the internal pointer to the beginning of the large object OCI-Lob-save - 将数据保存到大对象中 OCI-Lob-se

41、ek - Sets the internal pointer of the large object OCI-Lob-setBuffering - Changes current state of buffering for the large object OCI-Lob-size - Returns size of large object OCI-Lob-tell - Returns current position of internal pointer of large object OCI-Lob-truncate - Truncates large object OCI-Lob-

42、write - Writes data to 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

43、_execute - 执行一条语句 oci_fetch_all - 获取结果数据的所有行到一个数组 oci_fetch_array - Returns the next row from the result data as an associative or numeric array, or both oci_fetch_assoc - Returns the next row from the result data as an associative array oci_fetch_object - Returns the next row from the result data a

44、s an object oci_fetch_row - Returns the next row from the result data as a numeric array oci_fetch - Fetches the next row into result-buffer oci_field_is_null - 检查字段是否为 NULL oci_field_name - 返回字段名 oci_field_precision - 返回字段精度 oci_field_scale - 返回字段范围 oci_field_size - 返回字段大小 oci_field_type_raw - 返回字段

45、的原始 Oracle 数据类型 oci_field_type - 返回字段的数据类型 oci_free_statement - 释放关联于语句或游标的所有资源 oci_internal_debug - 打开或关闭内部调试输出 oci_lob_copy - Copies large object oci_lob_is_equal - Compares two LOB/FILE locators for equality oci_new_collection - 分配新的 collection 对象 oci_new_connect - 建定一个到 Oracle 服务器的新连接 oci_new_cu

46、rsor - 分配并返回一个新的游标(语句句柄) 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 - 返

47、回服务器版本信息 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

48、的别名 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() 的别名 ocidefinebyna

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 中等教育 > 小学课件

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报