Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Storing An Array In A Session

7:30 pm on Oct 30, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 11, 2004
votes: 0

i have an array full of things but i would like to use it throughout the whole site so how do i store it in a session


this script extracts an array

foreach ($pages as $value)

$_SESSION['$pages["$count"]'] = $value;

and sticks it into an array in a session but its not working... any ideas?

7:52 pm on Oct 30, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 19, 2003
votes: 0

You try:
$_SESSION['pages'] = $pages;

8:51 pm on Oct 30, 2004 (gmt 0)


WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
votes: 0

or something like

$_SESSION[$pages][$count] = $value;

hard to tell what exactly you need