Posted by Ken on 09/29/04 11:14
On 4/26/05, AndreaD <andrea.davidson@silene.co.uk> wrote:
> I need two bits of info...
>
> (i) Are there ANY cookies set?
>
> (ii) How many cookies are set?
>
> how do I find this information out?
>
> AD
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
you can access cookies by using the superglobal variable (as an array) $_COOKIE.
if ( isset($_COOKIE['cookiename']) )
{
// do some stuff. cookie with cookiename is set.
}
i don't know the best method to check how many cookies are set but i
guess you count the array $_COOKIE.
$number = count($_COOKIE)
hope this helps.
Ken
[Back to original message]
|