/ Published in: PHP
A little function used to set cookies as arrays of values instead of single combinations key->value. Note that it saves values as a stack.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function set_cronology($name,$value,$duration=7){ $max_stored_values=5; foreach($_COOKIE[$name] as $prop_crono=>$val_crono){ if($val_crono==$value) return; } if($prop_crono<$max_stored_values) else{ } }else return; } ?>