0

I have this record in data base row :

   a:2:
   {
     i:2;a:2:{s:6:"amount";d:150;s:11:"description";s:53:"value1";}
     i:3;a:2:{s:6:"amount";d:1800;s:11:"description";s:53:"value 2";}
   }

Is it Json or What exactly ? And how can i extract data from it ? I want to get each amount and description values

Ankit Singh
  • 1,477
  • 1
  • 13
  • 22
Fray
  • 250
  • 2
  • 5
  • 16

1 Answers1

3

It's serialized data. You can use unserialize() to turn it in to an array.

Difster
  • 3,264
  • 2
  • 22
  • 32
  • Thanks , but how can i access each data `$original_array=unserialize('...'); var_export($original_array);` – Fray Jul 31 '17 at 07:55
  • By using a `foreach()` loop. In your case, you have a multidimensional array (arrays within an array). There are tons of tutorials out there on that. – Difster Jul 31 '17 at 08:01