php - How to get Specific Value from Session Array in CI? -


i session :

echo '<pre>'; print_r($this->session->all_userdata()); exit; 

and result :

 array  (    [session_id] => 47fa796fbc6c5146a5ba0b1e596f4354    [ip_address] => ::1    [user_agent] => mozilla/5.0 (windows nt 6.1; rv:47.0) gecko/20100101 firefox/47.0    [last_activity] => 1468617532    [user_data] =>     [session_data] => array      (         [default] => english         [register] =>  register          [login] =>  login          [logout] => logout         [home] => home         [latest_event] => latest event         [events] => events         [contact_us] => contact         [submit_event] => submit event         [register_now] => register         [find_best_event_for_you] => find best event         [select_date] => select date         [find_event] => find event         [create_event_home] => create own new event         [create_event_home_txt] => bring people together, or turn passion business. eventbrite gives need host best event yet.         [select_city] => select city         [popular_events] => popular events         [ticket_details] => tickets & details         [ticket_from] => tickets         [free] => free         [what_you_want] =>  want          [message_placeholder_value] => please write message here...         [success_message] => thank you! message has been sent.         [send] => send         [all] =>         [email] => email         [for_get_password] =>  lost password?      )  [default] => 0 

)

i want value of [default] => english , not other array object. want store in variable, can't figure out how in ci.

use this

  //you can access session data session name using // default session name   $session_default = $this->session->userdata('default');    echo $session_default ; // english 

you can use this

   $data = $this->session->all_userdata();     $session_default = $data['session_data']['default']);      echo $session_default ;     // english 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -