• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doubt using session

Hi friends, forgives my bad English…

I am with a doubt using sessions, already I searched in forum and I did not find the solution.

The doubt is the following one:

I possess an Array of the following collection:
$arr = Array('idclient' => $idClient, 'name' => $nameClient);

necessary to insert this Array in one session:
$this->session->set_userdata('client', $arr);

The doubt is following now:
How I go to have access the value 'name' for example? Using

it returns emptiness.


hug. :cheese:

you set the session key to retrieve that array as client so
gets the array. If you want to extract name you have to do
$client = $this->session->userdata('client');
echo $client['name'];

simple and efficient! thanks! :cheese:

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.