What is the function of $_COOKIE in PHP and how can it be used to count cookies?
$_COOKIE in PHP is a superglobal array that holds all cookies sent by the client to the server. To count cookies, you can use the count() function on the $_COOKIE array.
// Counting cookies using $_COOKIE
$count = count($_COOKIE);
echo "Number of cookies: " . $count;