Assigning cookie names according to array index value
<?
setcookie("php[uid]", "1111111111111111", time()+3600);
setcookie("php[color]", "black", time()+3600);
setcookie("php[preference]", "english", time()+3600);
if (isset ($php)) {
while (list ($name, $value) = each ($php)) {
echo "$name = $value<br>\n";
}
}
?>
Related examples in the same category