Monday, 2 February 2015

Multiple Session Values

We can set multiple session at one time and easily fetch them in php Example:


<?php
<!DOCTYPE html>

<html>
<body>

<?php
session_start();


$_SESSION['mysession1']='php-guides1';
$_SESSION['mysession2']='php-guides2';
$_SESSION['mysession3']='php-guides3';
$_SESSION['mysession4']='php-guides4';
$_SESSION['mysession5']='php-guides5';
?>

<p style="color:red">Session Values=<?php 
echo "<pre style='color:red'>";
print_r($_SESSION);
echo "</pre>";?>
</p>

</body>
</html>
?>


Output Print:




No comments: