If I have 30 session variables and I want to do an if statement to only 10 of them.
if (empty($_SESSION['XYZ'])) {
$_SESSION['XYZ'] = 0;
}
what should I do? Do I call an if statement after every session variables that i needed for?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Consider putting the names of the keys in an array and then looping through with foreach.
An advantage is you can quickly add or remove keys to check.