n PHP, you can store arrays in cookies by serializing the array and then setting it as the cookie value. Here is an example of how to do it:
// Create an example array
$my_array = array('apple', 'banana', 'orange');
// Serialize the array
$serialized_array = serialize($my_array);
// Set the cookie with the serialized array
setcookie('my_cookie', $serialized_array, time() + 3600);
To retrieve the array from the cookie, you would first get the serialized string from the cookie value, and then unserialize it back into an array:
// Get the serialized array from the cookie
$serialized_array = $_COOKIE['my_cookie'];
// Unserialize the array
$my_array = unserialize($serialized_array);
// The array can now be used
echo $my_array[0]; // Output: apple