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/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Display Database
I need to create a shopping cart. I found this code online: http://conceptlogic.com/jcart/
Unfort

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redi

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

apart from cron
I need to run a php file every one hour. Is there any other solution apart from cron job?

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Parse XML
Good day,

I use oempro software and try to parse XMLReturn but it's not working for me, simpl

Different actions for different parts of a string
<?php
function dosomething($string, $else = '') {
if (empty($else))
$string

Multithreading design
Hi

I have come up with a Singleton class that manages a pool of database connections. Basical

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