php empty()和isset()的区别
empty() 判断变量是否为“空”,isset() 判断变量是否已经设置。
例:
$id=0;
empty($id)?print "It's empty .":print "It's $id ."; //结果:It's empty .
!isset($id)?print "It's empty .":print "It's $id ."; //结果:It's 0 .
empty() 判断变量是否为“空”,isset() 判断变量是否已经设置。
例:
$id=0;
empty($id)?print "It's empty .":print "It's $id ."; //结果:It's empty .
!isset($id)?print "It's empty .":print "It's $id ."; //结果:It's 0 .