How to check for variable existence in codeigniter(php)? newb question
Use the isset()
function to test if a variable has been declared.
if (isset($var)) echo $var;
Use the empty()
function to test if a variable has no content such as NULL, "", false or 0
.