2017-03-01 61 views
1

這是我用來檢查一個帖子值是否爲空或不在codeigniter中。檢查POST值Codeigniter

if($this->input->post('inputEmail')) { } 

只是想知道什麼是檢查它的最好方法,上述方法或

$temp = $this->input->post('inputEmail'); 
if(!empty($temp)) { } 
+0

的可能的複製[檢查是否可變空](http://stackoverflow.com/questions/8777591/check-if-variable-empty) –

+0

第一個是最好的從我的角度來看。 –

+0

一旦經過這個[鏈接](https://zainal.wordpress.com/2006/04/25/8/),你可以自己做出這個決定 – rahulsm

回答

0

在PHP isset //檢查檢查變量是否設置與否。

//嘗試這種

if(isset($tmp)) 
{ 
    //it is set 
} 

else 
{ 
    //not set 
}