store array into session variable and get it back later

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

i have a 2 dim array defined as following:

class CBreadcrumb
> {
>     // array holding the complete Breadcrumb
>     var $crumb = array();
>
>     /*
>      * Constructor
>      */
>     function CBreadcrumb()
>     {
>
>     }
>
>     /*
>      * Add new stage
>      */
>     function Add($name, $link, $id)
>     {
>         array_push($this->crumb,array('name' => $name, 'link' => $link,
> 'id' => $id));
>     }
> }
>
and its instance :

$bc = new CBreadcrumb();
>
> // filling the instance
> $bc->Add('Home',"https://www.myweb.com/framework/",0);
> $bc->Add('Language',"https://www.myweb.com/language/",1);
>
> // session must be started to store this breadcrumb
> $_SESSION['bc']=$bc;
>
later on i try to use the content of this array, bt without success.
Here is what i do:

$bci = array($_SESSION['bc']);
> array_push($bci,$_SESSION['bc']);
>
> foreach($bci as $key=>$value)
> {
>   echo "bci : ".$bci[$key]['name'];
>   echo "<br/>";
> }
>

how can i get the 'name' value for each row in this session stored array ?
thx.

-- 
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux