Is this bad practice?
if ($_SESSION['something'] == '')
{
echo 'the session is empty';
}
Is there a way to check if its empty or it is not set? I'm actualy doing this:
if (($_SESSION['something'] == '') || (!isset($_SESSION['something'])) {
echo 'the session is either empty or doesn't exist';
}
Does !isset
just checks if a $_SESSION['']
exist and doesn't check if, is there are values in the array or not
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…