I was doing a simple php code and I found a problem. I would want to access to the value of a specific position of a array of cookies, but I don't know why, I tried to use:
$value = $_COOKIE['conexio[cont]'];
But It doesn't works. That's my code:
<?php
if(!isset($_COOKIE['conexio'])) {
$valorinicial = 1;
setcookie('conexio[cont]', $valorinicial);
setcookie('conexio[data]', date('d-m-y h:m:s'));
}
else {
$value = $_COOKIE['conexio[cont]'];
$value = $value +1;
setcookie('conexio[cont]', $value);
setcookie('conexio[data]', date('d-m-y h:m:s'));
}
?>