Re: number of cookies and if there are any cookies set?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/26/05, AndreaD <andrea.davidson@xxxxxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux