Is it possible to store an array in a session in PHP?
Yes, it is possible to store an array in a session in PHP. To do this, you can simply assign the array to a session variable using the `$_SESSION` superglobal. This allows you to store and retrieve the array across different pages as long as the session is active.
<?php
// Start the session
session_start();
// Create an array
$array = array("apple", "banana", "cherry");
// Store the array in a session variable
$_SESSION['fruits'] = $array;
// Retrieve the array from the session
$fruits = $_SESSION['fruits'];
// Output the array
print_r($fruits);
?>