3 回答
TA贡献1874条经验 获得超12个赞
echo gettype($a); // outputs "string"
echo empty($a); // outputs true, in your environment this is 1
echo is_null($a); // outputs false, "" isn't null, in your environment this is probably blank
echo isset($x); // outputs false, in your environment this is probably blank
TA贡献1995条经验 获得超2个赞
你得到所有的结果:字符串、真、假和假
echo gettype($a); // outputs "string"
echo empty($a); // outputs 1 (true)
echo is_null($a); // outputs false, or "" in echo
echo isset($x); // outputs false, or "" in echo
您可以尝试以这种方式运行它以查看不同的结果:
echo gettype($a),'-',empty($a),'-',is_null($a),'-',isset($x),'-';
输出:string-1---
TA贡献1848条经验 获得超10个赞
echo gettype($a); // Outputs a "string" because the datatype used is a string
echo empty($a); // Outputs true, because the criteria that it is an empty string
echo is_null($a); // Outputs false, "" isn't null, this is probably blank
echo isset($x); //Outputs false because isset means "is set"
- 3 回答
- 0 关注
- 119 浏览
添加回答
举报