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

Last character removed
I have created a string from an array. I have inserted commas from my form values. I am trying to re

Multiple Pages
Hi. Im very new to php. I'm trying to create a basic login/registration page.

So I have a bas

bit of help needed
Im about to sort out my registration page for my website by customising a "registration" s

Cannot Display Array from Select Statement + Login question
Hi,
I'm new to PHP but so far so goog. I was assigend a project and I'm very close to completion.

LOOPing Problem
Hello All!

The following code loops through the data and displays the data accordingly. My p

Printing a webpage
I use this to print the webpage: o

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

Redistributing dependent dlls
Hai all ,

I have created an application in VC++ using VS2008 in a development machine which r

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

Finding digits in variable containing text, and IDing them
$romanstock = "http://www.remoteprice.com/data.asp?storeid=123&itemcode=456&typ

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