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

help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted de

Using cURL to PUT
Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code bel

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

Call db table from any PHP file
Hi,

I want to be able to call a database table that will be setup in another file called init

Can't find the problem (no error message)!
OK, here's the deal. This code is really weirdly formatted (sorry!) and hard to understand, so I'm g

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

Display search result
Hi!

I have a SQL database with information about albums and track (music).

This is wh

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

Table sorting
Hi,

I'm trying to modify the following in order to make the output table sorted alphabeticall

Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID

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