I have to check the session value, and check it with the constant/defined value and perform action.
The below code is not working. What I'm tyring to do is.
if the session value is A, then check it against the list array(i.e $get_abc), and perform some task if the session value is E, then check it against the list array(i.e $get_ef), and perform some task
<?php
$_SESSION['get_value'] = "A";
define ("ABC", serialize (array ("A", "B", "C")));
define ("D", serialize (array ("D")));
define ("EF", serialize (array ("E","F")));
$get_abc = unserialize(ABC);
$get_d = unserialize(D);
$get_ef = unserialize(EF);
if (in_array($_SESSION['get_value'], $get_abc)) {
.. do abc stuff..
}else if(in_array($_SESSION['get_value'], $get_d)) {
.. do d stuff..
}else if(in_array($_SESSION['get_value'], $get_ef)) {
.. do ef stuff..
}else{
.. do simple query..
}
?>
Any help