I was wondering if anyone could show me how to search this array that is in a session and see if it contains a value. I have posted the code below.
Thanks you.
$stack = array ('hello', 'world', 'where', 'are', 'money', 'chicken', 'run');
$_SESSION['user'] = $stack;
if($_SESSION['user'] does not contain('myname')){
echo 'no name';
}
Use in_array() function
example:
Also, might i suggest you just do it like this?