$_SESSION
` superglobal variable in PHP. Here's an example PHP program that demonstrates this :<?php
// Start the session
session_start();
// Set some session variables
$_SESSION["name"] = "John";
$_SESSION["age"] = 30;
// Get all session variable values
$session_values = array_values($_SESSION);
// Output the session values
print_r($session_values);
?>
Array
(
[0] => John
[1] => 30
)
session_start()
`, then set two session variables using the `$_SESSION
` superglobal. We then use the `array_values()
` function to get an array of all session variable values, and output the array using `print_r()
`.