Using unserialize()


Posted on 16th Feb 2014 07:03 pm by admin

Hi there.

I have some data in my database that is serialized.

e.g.

a:2:{i:0;s:9:"Test";i:1;s:4:"Another Test";}

I'm unsure how to use unserialize to convert it into a string in the format:

Test, Another Test

Currently I have:

Code: $radio_array = unserialize($radio);
foreach ($radio_array as $i => $value) {
print($radio_array[$i]);
}

But that throws errors. Any help appreciated, thanks

No comments posted yet

Your Answer:

Login to answer
198 Like 9 Dislike
Previous forums Next forums
Other forums

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

url- go to webpage
i have an input text field and submit button.

how do i make the url entered into the textfiel

Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

my sql select id and then update problem.
I need to select some auto incremented ids out of a database and then use those id in a where statem

need help in update query
i create a form for update. there are 8 columns in my mysql table. on my main page all the data is r

Displaying Column Names
I have a question regarding the ability to show the column names from my table/query.
What I'm lo

How could I combine these arrays??
Hello.. I'm trying to figure out a way to combine these first two arrays to get the last array..

retrieving more than one max key from an array?
so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and th

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash