How do I turn a string to an array
Posted: Tue Oct 10, 2017 5:54 am
Hello,
I have a string from my database table I want to turn into an array and get part of it. the string is as below
how do i do it?
Thanks
I have a string from my database table I want to turn into an array and get part of it. the string is as below
Code: Select all
$FromTable = '
a:11:{s:7:"form_id";s:4:"4821";s:9:"timestamp";s:10:"1501333433";s:7:"request";s:0:"";s:4:"role";s:6:"member";s:8:"_wpnonce";s:10:"23395536bf";s:16:"_wp_http_referer";s:10:"/register/";s:10:"user_login";s:11:"iCTTraining";s:10:"first_name";s:4:"Egbu";s:9:"last_name";s:0:"";s:10:"user_email";s:25:"Linksnetsystems@yahoo.com";s:5:"sr_id";s:7:"CALA038";}
'
//from the string, how do I get the value as follow
form_id = 4821
timestamp = 1501333433
......
user_email = Linksnetsystems@yahoo.com
sr_id = CALA038
//also if i need only the the value of user_email
Thanks