2011-02-02 41 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已經返回一個布爾值,你其實並不需要另一個測試功能。

相關問題