2011-02-02 111 views

回答

8

empty需要一个变量,如果parameter were passed by reference

Note:
empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim($name)) .

所以,你可以这样做:

$var = is_resource(true); 
echo empty($var); 

但作为is_resource已经返回一个布尔值,你其实并不需要另一个测试功能。

相关问题