0
是否可以通過Post/Get傳遞Null值?是否可以通過Post/Get傳遞Null值? (PHP)
null,我的意思是在isset()
上返回true,但在empty()
上返回false。
原因是,我想知道,如果我需要$_GET
額外的檢查,我正在檢查以下內容:
if (isset() && !empty()) {
// do stuff
} elseif (isset() && empty()) { // In other words, omit this one.
// do other stuff
} else {
//foo bar
}
感謝,
你是指'null'數據類型?我不這麼認爲,它是以字符串形式出現的,結合'isset'和'empty'是多餘的,'!empty'應該足夠了,除非你期望'0'有效 – Ghost 2015-04-02 11:30:09
@Ghost - 是的,我意味着空數據類型。 – 2015-04-02 11:52:04