Welcome to WebmasterWorld Guest from 3.227.2.109

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
posts:71
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

at

this script extracts an array

foreach ($pages as $value)

{
$count++;
$_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
posts:1001
votes: 0


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

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

Administrator

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

joined:July 24, 2001
posts:15756
votes: 0


or something like

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

hard to tell what exactly you need