




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、484个PHP必备的函数集484个PHP必备的函数集2010-11-22 16:49array_change_key_case-返回字符串键名全为小写或大写的数组array_chunk-将一个数组分割成多个array_combine-创建一个数组,用一个数组的值作为其键名,另一个数组的值作为其值array_count_values-统计数组中所有的值出现的次数array_diff_assoc-带索引检查计算数组的差集array_diff_key-使用键名比较计算数组的差集array_diff_uassoc-用用户提供的回调函数做索引检查来计算数组的差集array_diff_ukey-用回调函数
2、对键名比较计算数组的差集array_diff-计算数组的差集array_fill_keys-Fill an array with values,specifying keys array_fill-用给定的值填充数组array_filter-用回调函数过滤数组中的单元array_flip-交换数组中的键和值array_intersect_assoc-带索引检查计算数组的交集array_intersect_key-使用键名比较计算数组的交集array_intersect_uassoc-带索引检查计算数组的交集,用回调函数比较索引array_intersect_ukey-用回调函数比较键名来计算数
3、组的交集array_intersect-计算数组的交集array_key_exists-检查给定的键名或索引是否存在于数组中array_keys-返回数组中所有的键名array_map-将回调函数作用到给定数组的单元上array_merge_recursive-递归地合并一个或多个数组array_merge-合并一个或多个数组array_multisort-对多个数组或多维数组进行排序array_pad-用值将数组填补到指定长度array_pop-将数组最后一个单元弹出(出栈)array_product-计算数组中所有值的乘积array_push-将一个或多个单元压入数组的末尾(入栈)arra
4、y_rand-从数组中随机取出一个或多个单元array_reduce-用回调函数迭代地将数组简化为单一的值array_reverse-返回一个单元顺序相反的数组array_search-在数组中搜索给定的值,如果成功则返回相应的键名array_shift-将数组开头的单元移出数组array_slice-从数组中取出一段array_splice-把数组中的一部分去掉并用其它值取代array_sum-计算数组中所有值的和array_udiff_assoc-带索引检查计算数组的差集,用回调函数比较数据array_udiff_uassoc-带索引检查计算数组的差集,用回调函数比较数据和索引array_
5、udiff-用回调函数比较数据来计算数组的差集array_uintersect_assoc-带索引检查计算数组的交集,用回调函数比较数据array_uintersect_uassoc-带索引检查计算数组的交集,用回调函数比较数据和索引array_uintersect-计算数组的交集,用回调函数比较数据array_unique-移除数组中重复的值array_unshift-在数组开头插入一个或多个单元array_values-返回数组中所有的值array_walk_recursive-对数组中的每个成员递归地应用用户函数array_walk-对数组中的每个成员应用用户函数array-新建一个数组
6、arsort-对数组进行逆向排序并保持索引关系asort-对数组进行排序并保持索引关系compact-建立一个数组,包括变量名和它们的值count-计算数组中的单元数目或对象中的属性个数current-返回数组中的当前单元each-返回数组中当前的键/值对并将数组指针向前移动一步end-将数组的内部指针指向最后一个单元extract-从数组中将变量导入到当前的符号表in_array-检查数组中是否存在某个值key-从关联数组中取得键名krsort-对数组按照键名逆向排序ksort-对数组按照键名排序list-把数组中的值赋给一些变量natcasesort-用自然排序算法对数组进行不区分大小写字
7、母的排序natsort-用自然排序算法对数组排序next-将数组中的内部指针向前移动一位pos-current()的别名p rev-将数组的内部指针倒回一位range-建立一个包含指定范围单元的数组reset-将数组的内部指针指向第一个单元rsort-对数组逆向排序shuffle-将数组打乱sizeof-count()的别名sort-对数组排序uasort-使用用户自定义的比较函数对数组中的值进行排序并保持索引关联uksort-使用用户自定义的比较函数对数组中的键名进行排序usort-使用用户自定义的比较函数对数组中的值进行排序call_user_method_array-调用一个用户方法,同
8、时传递参数数组(已废弃)call_user_method-对特定对象调用用户方法(已废弃)class_exists-检查类是否已定义get_class_methods-返回由类的方法名组成的数组get_class_vars-返回由类的默认属性组成的数组get_class-返回对象的类名get_declared_classes-返回由已定义类的名字所组成的数组get_declared_interfaces-返回一个数组包含所有已声明的接口get_object_vars-返回由对象属性组成的关联数组get_parent_class-返回对象或类的父类名interface_exists-检查接口是否
9、已被定义is_a-如果对象属于该类或该类是此对象的父类则返回TRUE is_subclass_of-如果此对象是该类的子类,则返回TRUE method_exists-检查类的方法是否存在property_exists-检查对象或类是否具有该属性checkdate-验证一个格里高里日期date_default_timezone_get-取得一个脚本中所有日期时间函数所使用的默认时区date_default_timezone_set-设定用于一个脚本中所有日期时间函数的默认时区date_time_set-Sets the time date_timezone_get-Return time zo
10、ne relative to given DateTime date_timezone_set-Sets the time zone for the DateTime object date-格式化一个本地时间/日期getdate-取得日期/时间信息gettimeofday-取得当前时间gmdate-格式化一个GMT/UTC日期/时间gmmktime-取得GMT日期的UNIX时间戳gmstrftime-根据区域设置格式化GMT/UTC时间/日期idate-将本地时间日期格式化为整数localtime-取得本地时间microtime-返回当前Unix时间戳和微秒数mktime-取得一个日期的Un
11、ix时间戳strftime-根据区域设置格式化本地时间/日期strptime-解析由strftime()生成的日期/时间strtotime-将任何英文文本的日期时间描述解析为Unix时间戳time-返回当前的Unix时间戳chdir-改变目录chroot-改变根目录dir-directory类closedir-关闭目录句柄getcwd-取得当前工作目录opendir-打开目录句柄readdir-从目录句柄中读取条目rewinddir-倒回目录句柄scandir-列出指定路径中的文件和目录basename-返回路径中的文件名部分chgrp-改变文件所属的组chmod-改变文件模式chown-改变
12、文件的所有者clearstatcache-清除文件状态缓存copy-拷贝文件delete-参见unlink()或unset()dirname-返回路径中的目录部分disk_free_space-返回目录中的可用空间disk_total_space-返回一个目录的磁盘总大小diskfreespace-disk_free_space()的别名fclose-关闭一个已打开的文件指针feof-测试文件指针是否到了文件结束的位置fflush-将缓冲内容输出到文件fgetc-从文件指针中读取字符fgetcsv-从文件指针中读入一行并解析CSV字段fgets-从文件指针中读取一行fgetss-从文件指针中读
13、取一行并过滤掉HTML标记检查文件或目录是否存在将整个文件读入一个字符串将一个字符串写入文件file-把整个文件读入一个数组中取得文件的上次访问时间取得文件的inode修改时间取得文件的组取得文件的inode 取得文件修改时间取得文件的所有者取得文件的权限取得文件大小取得文件类型flock-轻便的咨询文件锁定fnmatch-用模式匹配文件名fopen-打开文件或者URL fpassthru-输出文件指针处的所有剩余数据fputcsv-将行格式化为CSV并写入文件指针fputs-fwrite()的别名fread-读取文件(可安全用于二进制文件)fscanf-从文件中格式化输入fseek-在文件指
14、针中定位fstat-通过已打开的文件指针取得文件信息ftell-返回文件指针读/写的位置ftruncate-将文件截断到给定的长度fwrite-写入文件(可安全用于二进制文件)glob-寻找与模式匹配的文件路径is_dir-判断给定文件名是否是一个目录is_executable-判断给定文件名是否可执行is_file-判断给定文件名是否为一个正常的文件is_link-判断给定文件名是否为一个符号连接is_readable-判断给定文件名是否可读is_uploaded_file-判断文件是否是通过HTTP POST上传的is_writable-判断给定的文件名是否可写is_writeable-i
15、s_writable()的别名lchgrp-Changes group ownership of symlink lchown-Changes user ownership of symlink link-建立一个硬连接linkinfo-获取一个连接的信息lstat-给出一个文件或符号连接的信息mkdir-新建目录move_uploaded_file-将上传的文件移动到新位置parse_ini_file-解析一个配置文件pathinfo-返回文件路径的信息pclose-关闭进程文件指针popen-打开进程文件指针readfile-输出一个文件readlink-返回符号连接指向的目标realpa
16、th-返回规范化的绝对路径名rename-重命名一个文件或目录rewind-倒回文件指针的位置rmdir-删除目录set_()的别名stat-给出文件的信息symlink-建立符号连接tempnam-建立一个具有唯一文件名的文件tmpfile-建立一个临时文件touch-设定文件的访问和修改时间umask-改变当前的umask unlink-删除文件mail-发送邮件abs-绝对值acos-反余弦acosh-反双曲余弦asin-反正弦asinh-反双曲正弦atan2-两个参数的反正切atan-反正切atanh-反双曲正切base_convert-在任意进制之间转换数字bindec-二进制转换为
17、十进制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-组合线性
18、同余发生器log10-以10为底的对数log1p-返回log(1+number),甚至当number的值接近零也能计算出准确结果log-自然对数max-找出最大值min-找出最小值mt_getrandmax-显示随机数的最大可能值mt_rand-生成更好的随机数mt_sra nd-播下一个更好的随机数发生器种子octdec-八进制转换为十进制pi-得到圆周率值pow-指数表达式rad2deg-将弧度数转换为相应的角度数rand-产生一个随机整数round-对浮点数进行四舍五入sin-正弦sinh-双曲正弦sqrt-平方根srand-播下随机数发生器种子tan-正切tanh-双曲正切mysql_
19、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操作中的
20、错误信息的数字编码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_fi
21、eld_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协议信息mys
22、ql_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服务器的持久连接my
23、sql_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查询,并不获取和缓存结果的行flush-刷新输出缓冲ob_clean-Clean(
24、erase)the output buffer ob_end_clean-Clean(erase)the output buffer and turn off output buffering ob_end_flush-Flush(send)the output buffer an dturn off output buffering ob_flush-Flush(send)the output buffer ob_get_clean-Get current buffer contents and delete current output buffer ob_get_contents-Ret
25、urn the contents of the output buffer ob_get_flush-Flush the output buffer,return it as astring and turn off output buffering ob_get_length-Return the length of the output buffer ob_get_level-Return the nesting level of the output buffering mechanism ob_get_status-Get status of output buffers ob_gzh
26、andler-ob_start callback function to gzip output buffer ob_implicit_flush-Turn implicit flush on/off ob_list_handlers-List all output handlers in use ob_start-Turn on output buffering output_add_rewrite_var-Add URL rewriter values output_reset_rewrite_vars-Reset URL rewriter values preg_grep-返回与模式匹配
27、的数组单元preg_last_error-Returns the error code of the last PCRE regex execution preg_match_all-进行全局正则表达式匹配preg_match-进行正则表达式匹配preg_quote-转义正则表达式字符preg_replace_callback-用回调函数执行正则表达式的搜索和替换preg_replace-执行正则表达式的搜索和替换preg_s plit-用正则表达式分割字符串session_cache_expire-Return current cache expire session_cache_limit
28、er-Get and/or set the current cache limiter session_commit-session_write_close()的别名session_decode-Decodes session data from astring session_destroy-Destroys all data registered to asession session_encode-将当前会话数据编码为一个字符串session_get_cookie_params-Get the session cookie parameters session_id-Get and/or
29、 set the current session id session_is_registered-Find out whether aglobal variable is registered in asession session_module_name-Get and/or set the current session module session_name-Get and/or set the current session name session_regenerate_id-Update the current session id with anewly generated o
30、ne session_register-Register one or more global variables with the current session session_save_path-Get and/or set the current session save path session_set_cookie_params-Set the session cookie parameters session_set_save_handler-Sets user-level session storage functions session_start-Initiali ze s
31、ession data session_unregister-Unregister aglobal variable from the current session session_unset-Free all session variables session_write_close-Write session data and end session ereg_replace-正则表达式替换ereg-正则表达式匹配eregi_replace-不区分大小写的正则表达式替换eregi-不区分大小写的正则表达式匹配split-用正则表达式将字符串分割到数组中spliti-用正则表达式不区分大小
32、写将字符串分割到数组中sql_regcase-产生用于不区分大小的匹配的正则表达式addcslashes-以C语言风格使用反斜线转义字符串中的字符addslashes-使用反斜线引用字符串bin2hex-将二进制数据转换成十六进制表示chop-rtrim()的别名chr-返回指定的字符chunk_split-将字符串分割成小块count_chars-返回字符串所用字符的信息crc32-计算一个字符串的crc32多项式crypt-One-way string encryption(hashing)echo-Output one or more strings explode-使用一个字符串分割另
33、一个字符串fprintf-Write aformatted string to astream get_html_translation_table-Returns the translation table used by htmlspecialchars()and htmlentities()hebrev-Convert logical Hebrew text to visual text hebrevc-Convert logical Hebrew text to visual text with newline conversion html_entity_decode-Convert
34、 all HTML entities to their applicable characters htmlentities-Convert all applicable characters to HTML entities htmlspecialchars_decode-Convert special HTML entities back to characters htmlspecialchars-Convert special characters to HTML entities implode-Join array elements with astring join-别名impl
35、ode()levenshtein-Calculate Levenshtein distance between two strings localeconv-Get numeric formatting information ltrim-Strip whitespace(or other characters)from the beginning of astring md5_ the md5 hash of agiven the md5 hash of astring metaphone-Calculate the metaphone key of astring money_format
36、-Formats anumber as acurrency string nl_langinfo-Query language and locale information nl2br-Inserts HTML line breaks before all newlines in astring number_format-Format anumber with grouped thousands ord-Return ASCII value of character parse_str-Parses the string into variables print-Output astring
37、 printf-Output aformatted string quoted_printable_decode-Convert aquoted-p rintable string to an 8bit string quotemeta-Quote meta characters rtrim-Strip whitespace(or other characters)from the end of astring setlocale-Set locale information sha1_ the sha1 hash of a the sha1 hash of astring similar_t
38、ext-Calculate the similarity between two strings soundex-Calculate the soundex key of astring sprintf-Return aformatted string sscanf-Parses input from astring according to aformat str_getcsv-Parse aCSV string into an array str_ireplace-Case-insensitive version of str_replace().str_pad-Pad astring t
39、o acertain length with another string str_repeat-Repeat astring str_replace-Replace all occurrences of the search string with the replacement string str_rot13-Perform the rot13 transform on astring str_shuffle-Randomly shuffles astring str_split-Convert astring to an array str_word_count-Return info
40、rmation about words used in astring strcasecmp-Binary safe case-insensitive string comparison strchr-别名str str()strcmp-Binary safe string comparison strcoll-Locale based string comparison strcspn-Find length of initial segment not matching mask strip_tags-Strip HTML and PHP tags from astring stripcs
41、lashes-Un-quote string quoted with addcslashes()stripos-Find position of first occurrence of acase-insensitive string stripslashes-Un-quote string quoted with addslashes()stristr-Case-insensitive strstr()strlen-Get string length strnatcasecmp-Case insensitive string comparisons using anatural ordera
42、lgorithm strnatcmp-String comparisons using anatural orderalgorithm strncasecmp-Binary safe case-insensitive string comparison of the first ncharacters strncmp-Binary safe string comparison of the first ncharacters strpbrk-Search astring for any of aset of characters strpos-Find position of first oc
43、currence of astring strrchr-Find the last occurrence of acharacter in astring strrev-Reverse astring strripos-Find position of last occurrence of acase-insensitive string in astring strrpos-Find position of last occurrence of achar in astring strspn-Find length of initial segment matching mask strst
44、r-Find first occurrence of astring strtok-Tokenize string strtolower-Make astring lowercase strtoupper-Make astring uppercase strtr-Translate certain characters substr_compare-Binary safe optionally case insensitive comparison of 2strings from an offset,up to length characters substr_count-Count the
45、 number of substring occurrences substr_replace-Replace text within aportion of astring substr-Return part of astring trim-Strip whitespace(or other characters)from the beginning and end of astring ucfirst-Make astrings first character uppercase ucwords-Uppercase the first character of each word in astring vfprintf-Write aforma
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 农庄出租合同标准文本
- 五人合同标准文本
- 农户认知对地理标志品牌使用意愿的影响研究
- 基于文化地理学的福建古典园林时空演变与谱系研究
- 个人公司佣金合同标准文本
- 面向危化品车辆的检测与重识别算法研究
- 兔毛购销合同标准文本
- 个人代理记账合同标准文本
- 交通旅游行业营销策略研究
- 产品生命周期管理与持续创新
- 《控制器接口》课件
- 超全自考英语二词汇表-含音标4500-个单词
- 外墙脚手架施工方案完整版
- 《驾驶室固定矩形窗》
- 境外工程项目安全生产管理规定
- 特殊作业安全管理监护人专项培训课件
- 2022年青海公务员考试申论试题(县乡卷)
- 电梯日管控、周排查、月调度内容表格
- 风电场项目可行性研究报告
- 临床医学专业医学影像学习题集
- 演唱会招商方案
评论
0/150
提交评论