I am doing some modifications for a site built primarily in ASP. However, the mods will be in PHP as the site is being moved over to that language.
When the user signs in, they are assigned cookies that look lkie so:
("mycook")("id")=23
("mycook")("pref")="HTML"
("mycook")("job")="janitor"
Now in asp, these can be referenced as:
request.cookies("mycook")("pref")
which would respond as "HTML"
Is there a similar syntax is PHP that anyone is aware of?
This doesn't seem to work:
echo $_COOKIE['mycook']['pref'];
echo $_COOKIE["mycook"]["pref"];
I saw a solution that uses a For Each -> , and I can see how that would work. But it just seems a bit of overkill (to loop through all the values just to print the one I am looking for) and I was wondering if anyone had any ideas?
Thanks in advance for your help.