CodeIgniter Forums
Transform 'user_data' to array. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Transform 'user_data' to array. (/showthread.php?tid=32929)



Transform 'user_data' to array. - El Forum - 08-09-2010

[eluser]pisio[/eluser]
Hi, again , it's me :p
How I can transform data from 'user_data' by ci_sessions table (table with data from session) to array ....

ci_sessions.user_data
Quote:a:3:{s:8:"username";s:4:"root";s:9:"logged_in";s:1:"1";s:4:"time";s:10:"1281412161";}
to
array (
'username' => 'root',
'logged_in' => '1',
'time' => '1281412161'
and more if there exist
);


Sorry for my bad English.
And 10x Smile


Transform 'user_data' to array. - El Forum - 08-09-2010

[eluser]cahva[/eluser]
It is serialized. To unserialize it use unserialize() function Smile


Transform 'user_data' to array. - El Forum - 08-09-2010

[eluser]pisio[/eluser]
[quote author="cahva" date="1281434769"]It is serialized. To unserialize it use unserialize() function Smile[/quote]Tnx. I have no idea for existence thise function.
Tongue