How to send array data with session variable using set_flashdata in codeigniter

 If you would like to send an array using set_flashdata() with sessions, just follow the script below:

$array_data = array(

                'firstName' => 'Lonarbi',
                'lastName' => 'Technologies'               

             );  

Now you can set flashdata as follows

$this->session->set_flashdata("DataArr",$array_data );

 

Then display it using flashdata() by storing it in a local variable and use print_r() to show the data as given under

$userdata = $this->session->flashdata('DataArr');
 print_r($userdata);

 

Previous
Next Post »
Related Posts Plugin for WordPress, Blogger...