网学网为需要PHP的朋友们搜集整理了基于empty函数的输出详解相关资料,希望对各位网友有所帮助!
$a = '''';
echo ''1.---------------''.empty($a).''<br>'';
$a = ''0'';
echo ''2.---------------''.empty($a).''<br>'';
$a = 0;
echo ''3.---------------''.empty($a).''<br>'';
$a = null;
echo ''4.---------------''.empty($a).''<br>'';
$a = ''null'';
echo ''5.---------------''.empty($a).''<br>'';
$a = ''abc'';
echo ''6.---------------''.empty($a).''<br>'';
$a = true;
echo ''7.---------------''.empty($a).''<br>'';
$a = ''true'';
echo ''8.---------------''.empty($a).''<br>'';
$a = false;
echo ''9.---------------''.empty($a).''<br>'';
$a = ''false'';
echo ''10.---------------''.empty($a).''<br>'';
$a = 1;
echo ''11.---------------''.empty($a).''<br>'';
$a = ''1'';
echo ''12.---------------''.empty($a).''<br>'';
$a = ''null'';
echo ''13.---------------''.!empty($a).''<br>'';
结果:
1.---------------1
2.---------------1
3.---------------1
4.---------------1
5.---------------
6.---------------
7.---------------
8.---------------
9.---------------1
10.---------------
11.---------------
12.---------------
13.---------------1