输出语句
echo
var_dump
print_r
printf
变量的操作
unset
预定义变量
$_SERVER
$_GET
$_POST
$_REQUEST
$_COOKIE,$_SESSION会话技术
$_FILES 文件上传
$GLOBALS 变量作用域
常量
define()
constant(‘常量名‘)
get_defined_constants()得到所有已经定义了的常量
魔术常量
__FUNCTION__ 当前函数的名字
__METHOD__ 当前方法的名字
__CLASS__ 当前类的名字
__NAMESPACE__ 当前命名空间的名字
进制转换
十进制:dec
二进制:bin
八进制:oct
十六进制:hex
int整型
float浮点数
string字符串
Heredoc、Nowdoc定界符
resource资源型
array数组
函数的原型
gettype获取变量的类型
settype将变量var的类型设置成type
isset判断一个变量是否存在
empty判断变量是否为空
is_type系列
is_int或is_integer判断一个变量是否为整型数据
is_float或is_double
is_numeric
is_bool
is_string
is_scalar
is_array
is_null
is_object
is_resource
其他运算符
clone|newnew是实例化一个对象,clone是克隆一个对象
@ 错误抑制符
instanceof判断一个对象是否为一个类的实例
循环结构
do-while
for
foreach
if
if-else
if-elseif-else
switch
while
循环的中断语句
continue结束本次的当前循环
break跳出了整个循环
文件载入
include
require
脚本的执行控制
die终止脚本
exit终止脚本
sleep延迟执行
函数
function
parameter形式参数
argument实际参数
return返回值
$GLOBALS
global
static定义静态局部变量的关键字
字符串函数
strlen获取字符串的长度
substr字符串截取函数
strtolower把字符串全部转换为小写
strtoupper把字符串全部转换为大写
strrev把字符串反转
strpos从左往右查找并返回字符串中某个字符的起始位置
strrpos从右往左进行查找
strchrstrstr的别名
strrchr从右往左截取指定位置
trim去除首尾空白字符后的结果
str_replace字符串替换函数
str_repeat重复字符串
时间函数
time时间戳
date时间戳格式化
strtotime时间字符串,转换为一个时间戳
microtime微妙的时间戳字符串
数学函数
abs取绝对值
floor向下取整
ceil向上取整
round四舍五入
rand|mt_rand获得一个指定区间的随机整数
pow求一个数的指数幂的值
sqrt求平方根
max|min求一组参数中的最大值或最小值
is_nan不是一个数字(not a number)返回 TRUE ,否则返回 FALSE
数组
element数组
index下标
key键
value值
foreach遍历函数
key
current
next
reset
while+each+list遍历
prev向上移动数组指针
end重置到最后一个元素!
each
list
数组的常用函数
count
range
array_merge
array_rand
shuffle
max|min
array_keys
array_values
array_combine
array_filp
in_array
array_key_exists
array_search
array_chunk
implode
explode
extract
compact
回调函数
array_map
排序函数
sort
asort
rsort
arsort