php,isset用法,及设置默认值 PHP代码


$channel = isset($_REQUEST['channel']) && intval($_REQUEST['channel']) ? intval($_REQUEST['channel']) : 7779;

isset — 检测变量是否已设置并且非 NULL

intval() 函数用于获取变量的整数值。

x && y 与 如果 x 和 y 都为 true,则返回 true

empty() - 检查一个变量是否为空

__isset()

unset() - 释放给定的变量

defined() - 检查某个名称的常量是否存在

the type comparison tables

array_key_exists() - 检查数组里是否有指定的键名或索引

is_null() - 检测变量是否为 NULL

错误控制 @ 运算符。


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回