empty只能判断变量。empty(trim($a)),像这样使用是错误的。 empty可以判断一个未经申明的变量,不会报错。它相当于: !isset($a) || $a==false 转载于:https://www.cnblogs.com/doubilaile/p/9176551.html