Sessions and arrays

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RedRasper
Forum Commoner
Posts: 48
Joined: Thu Apr 24, 2003 6:36 am

Sessions and arrays

Post by RedRasper »

Hey all!!

Just a question, been trying to find if its possible to store an array in a session?

Basically I'm going to have some data, but I don't know how much there is going to be.

Could anyone advise?

Cheers
RedRasper
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

arrays can be assigned to a member of $_SESSION.

Code: Select all

<?php
session_start();
$_SESSION['myArray'] = array(1,2,3);
?>
Post Reply