I am trying somethig like this:
$os = "mac,nt,irix,linux";
$os_pieces = explode(",", $os);
$find = 'irix';
if (in_array($find, $os_pieces)) {
$errore .= "irix has been found<br>";
} else {
$errore .= "not found irix<br>";
}
and it is working
then I put $os in a crypted cookie and I get it back
I decode the cookie:
$key = 'mykey';
$code = base64_decode($_COOKIE['my_cookie_value']);
$my_cookie_value = mcrypt_cbc(MCRYPT_DES, $key, $code, MCRYPT_DECRYPT);
then I do the same of before but it doesn't work :-((
$os_pieces = explode(",", $my_cookie_value);
$find = 'irix';
if (in_array($find, $os_pieces)) {
$errore .= "irix has been found<br>";
} else {
$errore .= "not found irix<br>";
}
I get not found :-(
The values in array seems to be ok but the function is_array doesn't work :-(
I am becoming crazy, anybody could help ?
Thanks a lot