且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该在哪里使用isset()和!empty()

更新时间:2023-02-06 18:01:39

isset vs. !空

FTA:

"isset()检查变量是否具有 值包括(False,0或为空 字符串),但不能为NULL.返回TRUE 如果var存在;否则为假.

"isset() checks if a variable has a value including (False, 0 or empty string), but not NULL. Returns TRUE if var exists; FALSE otherwise.

另一方面,empty()函数 检查变量是否为空 值空字符串,0,NULL或 错误的.如果var有一个 非空且非零值."

On the other hand the empty() function checks if the variable has an empty value empty string, 0, NULL or False. Returns FALSE if var has a non-empty and non-zero value."