1.数组函数
array_product()
array_search()
array_unique()
extract()
in_array()
array_count_values()
array_key_exists()
array_sum()
2.文件函数
basename()
dirname()
feof()
fflush()
file()
file_exists()
file_get_contents()
file_put_contents
filesize()
filetype()
flock()
is_dir()
is_executable()
parse_ini_file()
tempnam()
tmpfile()
touch()
参数 | 描述 |
---|---|
dir | 必需。规定创建临时文件的目录。 |
prefix | 必需。规定文件名的开头。 |
<?php
echo tempnam("C:\inetpub\testweb","TMP0");
?>
输出:C:\inetpub\testweb\TMP1.tmp
3.字符串函数
addslashes()
chr()
convert_uuencode()
convert_uudecode()
crc32()
crypt()
explode()
htmlentities()
htmlspecialchars_decode()
htmlspecialchars()
implode()
md5()
md5_file()
nl2br()
number_format()
ord()
parse_str()
str_ireplace()
str_shuffle()
str_split()
str_word_count()
strcasecmp()
strchr()
strcmp()
strip_tags()
stripslashes()
stripos()
strpos()
strrev()
strtolower()
strtoupper()
substr()
substr_replace()
ucwords()
parse_url();解析URL,返回数组,[HOST]="ABC.COM";[PATH]="INDEX.PHP"
4.字符串加密
md5
urlencode
urldecode
base64_encode
base64_decode
convert_uuencode()
convert_uudecode()
5.正则表达式
[^a-z]
str_replace();
ereg_replace();
preg_match();
preg_match_all();
preg_replace();
preg_split();
6.数据验证
is_numeric();
is_bool();
is_string();
intval();
strval();
settype($input,integer); 设置类型
7.缓冲区控制函数
flush — 刷新输出缓冲区
保存在输出缓冲区的内容会被发送到浏览器
ob_start — 打开输出缓冲区
这样所有的输出信息不在直接发送到浏览器,而是保存在输出缓冲区里面
ob_get_contents — 返回输出缓冲区的内容
如果你想以后处理输出的内容,可以调用这个函数保留一个备份
ob_get_length — 返回输出缓冲区的内容长度
ob_end_flush — 结束(发送)输出缓冲区的内容,关闭输出缓冲区
ob_end_clean — 删除(放弃)输出缓冲区的内容,关闭输出缓冲区
如果你的程序发现输出内容有问题,可以放弃所有输出内容,可以防止泄漏某些秘密信息
ob_implicit_flush — 打开或关闭直接刷新
打开后,每个脚本输出都直接发送到浏览器,不再需要调用 flush(),