-1

I got this format from the wp_postmate table. How can I convert it to a readable format?

a:11:{i:2;a:3:{s:10:"field_name";s:7:"Address";s:11:"field_value";s:47:" govindpuri kalkaji, new delhi-110019";s:11:"field_label";N;}i:3;a:3:{s:10:"field_name";s:4:"City";s:11:"field_value";s:9:"NEW DELHI";s:11:"field_label";N;}i:6;a:3:{s:10:"field_name";s:14:"DateOfPurchase";s:11:"field_value";s:10:"2020-09-15";s:11:"field_label";N;}i:5;a:3:{s:10:"field_name";s:5:"Email";s:11:"field_value";s:31:"sharikbillionaire@gmail.com";s:11:"field_label";N;}i:1;a:3:{s:10:"field_name";s:9:"Last-name";s:11:"field_value";s:5:"matin";s:11:"field_label";N;}i:8;a:3:{s:10:"field_name";s:16:"Nameoftheproduct";s:11:"field_value";s:10:"Mohd Afzal";s:11:"field_label";N;}i:7;a:3:{s:10:"field_name";s:7:"OrderId";s:11:"field_value";s:10:"1236547896";s:11:"field_label";N;}i:4;a:3:{s:10:"field_name";s:7:"PinCode";s:11:"field_value";s:6:"110019";s:11:"field_label";N;}i:10;a:3:{s:10:"field_name";s:14:"mc4wp_checkbox";s:11:"field_value";s:2:"No";s:11:"field_label";N;}i:9;a:3:{s:10:"field_name";s:10:"reviewfile";s:11:"field_value";s:32:"e570b19fc4a826c333e4ac78ee19393c";s:11:"field_label";N;}i:0;a:3:{s:10:"field_name";s:9:"your-name";s:11:"field_value";s:4:"mohd";s:11:"field_label";N;}}

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
hari
  • 11
  • 2
  • that's not valid JSON ... and how are we supposed to help you if you don't tell us the format you want to see - also, is this JSON, or some javascript object you've parsed from JSON? – Jaromanda X Sep 25 '20 at 06:05
  • 1
    It's a serialized data representation. Use ```unserialize``` to decode it to an array. But it will not work now, because the string was edited. This should never be done. There are 2 errors in your string: (" govindpuri kalkaji, new delhi-110019" has a length of 37 not 47. "sharikbillionaire@gmail.com" has a length of 27 not 31) https://www.php.net/manual/en/function.unserialize.php – akrys Sep 25 '20 at 06:45
  • Perhaps this will help you, too: https://stackoverflow.com/questions/48249972/php-error-notice-unserialize-error-at-offset-438-of-750-bytes-in – akrys Sep 25 '20 at 06:53

1 Answers1

0

The above data was stored in a serialized format so you can simply use unserialize() to get the data in an array.