首页
vue
TypeScript
JavaScript
scss
css3
html5
php
MySQL
redis
jQuery
位置:
php 中文手册
php 内置函数
php 字符串函数
addcslashes()
以 C 语言风格使用反斜线转义字符串中的字符
addslashes()
使用反斜线引用字符串
bin2hex()
函数把包含数据的二进制字符串转换为十六进制值
chop()
rtrim()的别名
chr()
返回指定的字符
chunk_split()
将字符串分割成小块
convert_cyr_string()
将字符由一种 Cyrillic 字符转换成另一种
convert_uudecode()
解码一个 uuencode 编码的字符串
convert_uuencode()
使用 uuencode 编码一个字符串
count_chars()
返回字符串所用字符的信息
crc32()
计算一个字符串的 crc32 多项式
crypt()
单向字符串散列
echo()
输出一个或多个字符串
explode()
使用一个字符串分割另一个字符串
fprintf()
将格式化后的字符串写入到流
get_html_translation_table()
hebrevc()
hex2bin()
转换十六进制字符串为二进制字符串
html_entity_decode()
将HTML实体转换为相应的字符
htmlentities()
将字符转换为 HTML 转义字符
htmlspecialchars_decode()
将特殊的 HTML 实体转换回普通字符
htmlspecialchars()
将特殊字符转换为 HTML 实体
implode()
将一个一维数组的值转化为字符串
join()
别名implode()
lcfirst()
使一个字符串的第一个字符小写
levenshtein()
计算两个字符串之间的编辑距离
localeconv()
获取数字格式信息
ltrim()
删除字符串开头的空白字符(或其他字符)
md5_file()
计算指定文件的 MD5 散列值
md5()
计算字符串的 MD5 散列值
metaphone()
计算字符串的变音键
money_format()
将数字格式化成货币字符串
nl_langinfo()
查询语言和区域设置信息
nl2br()
在字符串所有新行之前插入 HTML 换行标记
number_format()
以千位分隔符方式格式化一个数字
ord()
转换字符串第一个字节为 0-255 之间的值
parse_str()
将字符串解析成多个变量
print()
输出字符串
printf()
输出格式化字符串
quoted_printable_decode()
将 quoted-printable 字符串转换为 8-bit 字符串
quoted_printable_encode()
将 8-bit 字符串转换成 quoted-printable 字符串
quotemeta()
转义元字符集
rtrim()
删除字符串末端的空白字符(或者其他字符)
setlocale()
设置地区信息
sha1_file()
计算文件的 sha1 散列值
sha1()
计算字符串的 sha1 散列值
similar_text()
计算两个字符串的相似度
soundex()
计算字符串的soundex键
sprintf()
返回格式化字符串
sscanf()
根据指定格式解析输入的字符
str_getcsv()
解析 CSV 字符串为一个数组
str_ireplace()
str_replace()的忽略大小写版本
str_pad()
使用另一个字符串填充字符串为指定长度
str_repeat()
重复一个字符串
str_replace()
子字符串替换
str_rot13()
对字符串执行 ROT13 转换
str_shuffle()
随机打乱一个字符串
str_split()
将字符串转换为数组
str_word_count()
返回字符串中单词的使用情况
strcasecmp()
二进制安全比较字符串(不区分大小写)
strchr()
别名strstr()
strcmp()
二进制安全字符串比较
strcoll()
基于区域设置的字符串比较
strcspn()
获取不匹配遮罩的起始子字符串的长度
strip_tags()
从字符串中去除 HTML 和 PHP 标记
stripcslashes()
反引用一个使用addcslashes()转义的字符串
stripos()
查找字符串首次出现的位置(不区分大小写)
stripslashes()
反引用一个引用字符串
stristr()
strstr()函数的忽略大小写版本
strlen()
获取字符串长度
strnatcasecmp()
使用“自然顺序”算法比较字符串(不区分大小写)
strnatcmp()
使用自然排序算法比较字符串
strncasecmp()
二进制安全比较字符串开头的若干个字符(不区分大小写)
strncmp()
二进制安全比较字符串开头的若干个字符
strpbrk()
在字符串中查找一组字符的任何一个字符
strpos()
查找字符串首次出现的位置
strrchr()
查找指定字符在字符串中的最后一次出现
strrev()
反转字符串
strripos()
计算指定字符串在目标字符串中最后一次出现的位置(不区分大小写)
strrpos()
计算指定字符串在目标字符串中最后一次出现的位置
strspn()
计算字符串中全部字符都存在于指定字符集合中的第一段子串的长度
strstr()
查找字符串的首次出现
strtok()
标记分割字符串
strtoupper()
将字符串转化为大写
strtr()
转换指定字符
strtolower()
将字符串转化为小写
substr_compare()
二进制安全比较字符串(从偏移位置比较指定长度)
substr_count()
计算字串出现的次数
substr_replace()
替换字符串的子串
substr()
返回字符串的子串
trim()
去除字符串首尾处的空白字符(或者其他字符)
ucfirst()
将字符串的首字母转换为大写
ucwords()
将字符串中每个单词的首字母转换为大写
vfprintf()
将格式化字符串写入流
wordwrap()
打断字符串为指定数量的字串
php 数组函数
array_change_key_case()
array_chunk()
将一个数组分割成多个
array_column()
返回数组中指定的一列
array_combine()
创建一个数组,用一个数组的值作为其键名,另一个数组的值作为其值
array_diff_assoc()
带索引检查计算数组的差集
array_diff_key()
使用键名比较计算数组的差集
array_diff_ukey()
用回调函数对键名比较计算数组的差集
array_diff()
计算数组的差集
array_fill_keys()
使用指定的键和值填充数组
array_fill()
用给定的值填充数组
array_filter()
用回调函数过滤数组中的单元
array_flip()
交换数组中的键和值
array_intersect_assoc()
带索引检查计算数组的交集
array_intersect_key()
使用键名比较计算数组的交集
array_intersect_uassoc()
带索引检查计算数组的交集,用回调函数比较索引
array_intersect_ukey()
用回调函数比较键名来计算数组的交集
array_intersect()
计算数组的交集
array_key_exists()
检查数组里是否有指定的键名或索引
array_key_first()
Gets the first key of an array
array_key_last()
Gets the last key of an array
array_keys()
返回数组中部分的或所有的键名
array_map()
为数组的每个元素应用回调函数
array_merge_recursive()
递归地合并一个或多个数组
array_merge()
合并一个或多个数组
array_multisort()
对多个数组或多维数组进行排序
array_pad()
以指定长度将一个值填充进数组
array_pop()
弹出数组最后一个单元(出栈)
array_product()
计算数组中所有值的乘积
array_push()
将一个或多个单元压入数组的末尾(入栈)
array_rand()
从数组中随机取出一个或多个单元
array_reduce()
用回调函数迭代地将数组简化为单一的值
array_replace_recursive()
使用传递的数组递归替换第一个数组的元素
array_replace()
使用传递的数组替换第一个数组的元素
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_exists()
别名array_key_exists()
key()
从关联数组中取得键名
krsort()
对数组按照键名逆向排序
ksort()
对数组按照键名排序
list()
把数组中的值赋给一组变量
natcasesort()
用“自然排序”算法对数组进行不区分大小写字母的排序
natsort()
用“自然排序”算法对数组排序
next()
将数组中的内部指针向前移动一位
pos()
current()的别名
prev()
将数组的内部指针倒回一位
range()
根据范围创建数组,包含指定的元素
reset()
将数组的内部指针指向第一个单元
rsort()
对数组逆向排序
shuffle()
打乱数组
sizeof()
count()的别名
sort()
对数组排序
uasort()
使用用户自定义的比较函数对数组中的值进行排序并保持索引关联
uksort()
使用用户自定义的比较函数对数组中的键名进行排序
usort()
使用用户自定义的比较函数对数组中的值进行排序
array_diff_uassoc()
使用自定义提供的回调函数做索引检查来计算数组的差集
php 文件目录函数
chdir()
改变目录
chroot()
改变根目录
closedir()
关闭目录句柄
dir()
返回一个 Directory 类实例
getcwd()
取得当前工作目录
opendir()
打开目录句柄
readdir()
从目录句柄中读取条目
rewinddir()
倒回目录句柄
scandir()
列出指定路径中的文件和目录
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()的别名
lchgrp()
修改符号链接的所有组
lchown()
修改符号链接的所有者
link()
建立一个硬连接
linkinfo()
获取一个连接的信息
lstat()
给出一个文件或符号连接的信息
mkdir()
新建目录
move_uploaded_file()
将上传的文件移动到新位置
parse_ini_file()
解析一个配置文件
parse_ini_string()
解析配置字符串
pathinfo()
返回文件路径的信息
pclose()
关闭进程文件指针
popen()
打开进程文件指针
readfile()
输出文件
readlink()
返回符号连接指向的目标
realpath_cache_get()
获取真实目录缓存的详情
realpath_cache_size()
获取真实路径缓冲区的大小
realpath()
返回规范化的绝对路径名
rename()
重命名一个文件或目录
rewind()
倒回文件指针的位置
rmdir()
删除目录
set_file_buffer()
stream_set_write_buffer()的别名
stat()
给出文件的信息
symlink()
建立符号连接
tempnam()
建立一个具有唯一文件名的文件
tmpfile()
建立一个临时文件
touch()
设定文件的访问和修改时间
umask()
改变当前的 umask
unlink()
删除文件
php 过滤函数
filter_has_var()
检测是否存在指定类型的变量
filter_id()
返回与某个特定名称的过滤器相关联的id
filter_input_array()
获取一系列外部变量,并且可以通过过滤器处理它们
filter_input()
通过名称获取特定的外部变量,并且可以通过过滤器处理它
filter_list()
返回所支持的过滤器列表
filter_var_array()
获取多个变量并且过滤它们
filter_var()
使用特定的过滤器过滤一个变量
php 日期时间函数
checkdate()
date_add()
date_create_from_format()
date_create_immutable_from_format()
date_create_immutable()
date_create()
date_date_set()
date_default_timezone_get()
date_default_timezone_set()
date_diff()
date_format()
date_get_last_errors()
date_interval_create_from_date_string()
date_interval_format()
date_isodate_set()
date_modify()
date_offset_get()
date_parse_from_format()
date_parse()
date_sub()
date_sun_info()
date_sunrise()
date_sunset()
date_time_set()
date_timestamp_get()
date_timestamp_set()
date_timezone_get()
date_timezone_set()
date()
getdate()
gettimeofday()
gmdate()
gmmktime()
gmstrftime()
idate()
localtime()
microtime()
mktime()
strftime()
strptime()
strtotime()
time()
timezone_abbreviations_list()
timezone_identifiers_list()
timezone_location_get()
timezone_name_from_abbr()
timezone_name_get()
timezone_offset_get()
timezone_open()
timezone_transitions_get()
timezone_version_get()
php 变量处理函数
boolval()
debug_zval_dump()
doubleval()
empty()
floatval()
get_defined_vars()
get_resource_type()
gettype()
import_request_variables()
intval()
is_array()
is_bool()
is_callable()
is_countable()
is_double()
is_float()
is_int()
is_integer()
is_iterable()
is_long()
is_null()
is_numeric()
is_object()
is_real()
is_resource()
is_scalar()
is_string()
isset()
print_r()
serialize()
settype()
strval()
unserialize()
unset()
var_dump()
var_export()
php 网址URL函数
base64_decode()
base64_encode()
get_headers()
get_meta_tags()
http_build_query()
parse_url()
rawurldecode()
rawurlencode()
urldecode()
urlencode()
php 网络函数
checkdnsrr()
closelog()
define_syslog_variables()
dns_check_record()
dns_get_mx()
dns_get_record()
fsockopen()
gethostbyaddr()
gethostbyname()
gethostbynamel()
gethostname()
getmxrr()
getprotobyname()
getprotobynumber()
getservbyname()
getservbyport()
header_register_callback()
header_remove()
header()
headers_list()
headers_sent()
http_response_code()
inet_ntop()
inet_pton()
ip2long()
long2ip()
openlog()
pfsockopen()
setcookie()
setrawcookie()
socket_get_status()
socket_set_blocking()
socket_set_timeout()
syslog()
php 会话函数session
session_abort()
放弃会话阵列更改并完成会话
session_cache_expire()
session_cache_limiter()
session_commit()
session_create_id()
创建新的会话ID
session_decode()
session_destroy()
session_encode()
session_gc()
执行会话数据垃圾收集
session_get_cookie_params()
session_id()
session_is_registered()
session_module_name()
session_name()
session_regenerate_id()
session_register_shutdown()
session_register()
在当前会话中注册一个或多个全局变量
session_reset()
用原始值重新初始化会话数组
session_save_path()
session_set_cookie_params()
session_set_save_handler()
session_start()
session_status()
session_unregister()
从当前会话中注销全局变量
session_unset()
session_write_close()
写入会话数据并结束会话
php 数学函数
abs()
绝对值
acos()
反余弦
acosh()
反双曲余弦
asin()
反正弦
asinh()
反双曲正弦
atan2()
两个参数的反正切
atan()
反正切
atanh()
反双曲正切
base_convert()
在任意进制之间转换数字
bindec()
二进制转换为十进制
ceil()
进一法取整
cos()
余弦
cosh()
双曲余弦
decbin()
十进制转换为二进制
dechex()
十进制转换为十六进制
decoct()
十进制转换为八进制
deg2rad()
将角度转换为弧度
exp()
计算<strong><code>e</code></strong>的指数
expm1()
返回 exp(number)- 1,甚至当 number 的值接近零也能计算出准确结果
floor()
舍去法取整
fmod()
返回除法的浮点数余数
getrandmax()
显示随机数最大的可能值
hexdec()
十六进制转换为十进制
hypot()
计算一直角三角形的斜边长度
intdiv()
php7
对除法结果取整
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()
双曲正切
php 邮件函数mail
ezmlm_hash()
mail()
php 密码散列哈希函数
password_get_info()
password_hash()
password_needs_rehash()
password_verify()
hash_algos()
hash_copy()
hash_equals()
hash_file()
hash_final()
hash_hkdf()
hash_hmac_algos()
hash_hmac_file()
hash_hmac()
hash_init()
hash_pbkdf2()
hash_update_file()
hash_update_stream()
hash_update()
hash()
php 选项信息函数
assert_options()
assert()
cli_get_process_title()
cli_set_process_title()
dl()
extension_loaded()
gc_collect_cycles()
gc_disable()
gc_enable()
gc_enabled()
gc_mem_caches()
php7
gc_status()
get_cfg_var()
get_current_user()
get_defined_constants()
get_extension_funcs()
get_include_path()
get_included_files()
get_loaded_extensions()
get_magic_quotes_gpc()
get_magic_quotes_runtime()
get_required_files()
get_resources()
php7
getenv()
getlastmod()
getmygid()
getmyinode()
getmypid()
getmyuid()
getopt()
getrusage()
ini_alter()
ini_get_all()
ini_get()
ini_restore()
ini_set()
magic_quotes_runtime()
main()
memory_get_peak_usage()
memory_get_usage()
php_ini_loaded_file()
php_ini_scanned_files()
php_logo_guid()
php_sapi_name()
php_uname()
phpcredits()
phpinfo()
phpversion()
putenv()
restore_include_path()
set_include_path()
set_magic_quotes_runtime()
set_time_limit()
sys_get_temp_dir()
version_compare()
zend_logo_guid()
zend_thread_id()
zend_version()
call_user_func_array()
call_user_func()
create_function()
forward_static_call_array()
forward_static_call()
func_get_arg()
func_get_args()
func_num_args()
function_exists()
get_defined_functions()
register_shutdown_function()
register_tick_function()
unregister_tick_function()
connection_aborted()
connection_status()
constant()
define()
defined()
die()
eval()
exit()
get_browser()
__halt_compiler()
highlight_file()
highlight_string()
hrtime()
ignore_user_abort()
pack()
php_check_syntax()
php_strip_whitespace()
sapi_windows_cp_conv()
sapi_windows_cp_get()
sapi_windows_cp_is_utf8()
sapi_windows_cp_set()
sapi_windows_generate_ctrl_event()
sapi_windows_set_ctrl_handler()
sapi_windows_vt100_support()
show_source()
sleep()
sys_getloadavg()
time_nanosleep()
time_sleep_until()
uniqid()
unpack()
usleep()
php 执行命令函数
escapeshellarg()
把字符串转码为可以在 shell 命令里使用的参数
escapeshellcmd()
shell 元字符转义
exec()
执行一个外部程序
passthru()
执行外部程序并且显示原始输出
proc_close()
关闭由proc_open()打开的进程并且返回进程退出码
proc_get_status()
获取由proc_open()函数打开的进程的信息
proc_nice()
修改当前进程的优先级
proc_open()
执行一个命令,并且打开用来输入/输出的文件指针
proc_terminate()
杀除由 proc_open 打开的进程
shell_exec()
通过 shell 环境执行命令,并且将完整的输出以字符串的方式返回
system()
执行外部程序,并且显示输出
php 输出缓冲函数
flush()
ob_clean()
ob_end_clean()
ob_end_flush()
ob_flush()
ob_get_clean()
ob_get_contents()
ob_get_flush()
ob_get_length()
ob_get_level()
ob_get_status()
ob_gzhandler()
ob_implicit_flush()
ob_list_handlers()
ob_start()
output_add_rewrite_var()
output_reset_rewrite_vars()
php 流数据函数stream
set_socket_blocking()
stream_bucket_append()
stream_bucket_make_writeable()
stream_bucket_new()
stream_bucket_prepend()
stream_context_create()
stream_context_get_default()
stream_context_get_options()
stream_context_get_params()
stream_context_set_default()
stream_context_set_option()
stream_context_set_params()
stream_copy_to_stream()
stream_filter_append()
stream_filter_prepend()
stream_filter_register()
stream_filter_remove()
stream_get_contents()
stream_get_filters()
stream_get_line()
stream_get_meta_data()
stream_get_transports()
stream_get_wrappers()
stream_is_local()
stream_isatty()
stream_notification_callback()
stream_register_wrapper()
stream_resolve_include_path()
stream_select()
stream_set_blocking()
stream_set_chunk_size()
stream_set_read_buffer()
stream_set_timeout()
stream_set_write_buffer()
stream_socket_accept()
stream_socket_client()
stream_socket_enable_crypto()
stream_socket_get_name()
stream_socket_pair()
stream_socket_recvfrom()
stream_socket_sendto()
stream_socket_server()
stream_socket_shutdown()
stream_supports_lock()
stream_wrapper_register()
stream_wrapper_restore()
stream_wrapper_unregister()
php 错误处理日志函数
debug_backtrace()
debug_print_backtrace()
error_clear_last()
php7
error_get_last()
error_log()
error_reporting()
restore_error_handler()
restore_exception_handler()
set_error_handler()
set_exception_handler()
trigger_error()
user_error()
php 伪随机数产生器
random_bytes()
php7
random_int()
php7
Zend引擎Tokenizer
token_get_all()
token_name()
php 类对象函数
__autoload()
call_user_method_array()
call_user_method()
class_alias()
class_exists()
get_called_class()
get_class_methods()
get_class_vars()
get_class()
get_declared_classes()
get_declared_interfaces()
get_declared_traits()
get_object_vars()
get_parent_class()
interface_exists()
is_a()
is_subclass_of()
method_exists()
property_exists()
trait_exists()