0

Any one know how to read this data with php ?

a:5:{i:0;a:2:{s:4:"name";s:25:"1 whole fish, skin intact";s:4:"note";s:0:"";}i:1;a:2:{s:4:"name";s:22:"4 1/2 cups kosher salt";s:4:"note";s:0:"";}i:2;a:2:{s:4:"name";s:14:"3-4 egg whites";s:4:"note";s:0:"";}i:3;a:2:{s:4:"name";s:13:"1/4 cup water";s:4:"note";s:0:"";}i:4;a:2:{s:4:"name";s:105:"aromatics of your choice (garlic cloves, lemon wedges, bay leaves, shallots, sprigs of thyme and parsely)";s:4:"note";s:0:"";}}
Ideal Bakija
  • 629
  • 5
  • 14
  • 2
    That's a serialized php array. `$hello = unserialize('the string in your question'); var_dump($hello);` – M. Eriksson Aug 01 '17 at 19:04
  • 3
    In my opinion, we should chill a bit with the down voting on this question. Sure, it doesn't contain any attempts, but if you have no idea what that string is, how would you even start searching for it? – M. Eriksson Aug 01 '17 at 19:11

1 Answers1

2

Use unserialize to convert this serialized array back into an array.

Example:

$serialized = 'a:5:{i:0;a:2:{s:4:"name";s:25:"1 whole fish, skin intact";s:4:"note";s:0:"";}i:1;a:2:{s:4:"name";s:22:"4 1/2 cups kosher salt";s:4:"note";s:0:"";}i:2;a:2:{s:4:"name";s:14:"3-4 egg whites";s:4:"note";s:0:"";}i:3;a:2:{s:4:"name";s:13:"1/4 cup water";s:4:"note";s:0:"";}i:4;a:2:{s:4:"name";s:105:"aromatics of your choice (garlic cloves, lemon wedges, bay leaves, shallots, sprigs of thyme and parsely)";s:4:"note";s:0:"";}}';

var_dump(unserialize($serialized)); // array
Dan
  • 5,140
  • 2
  • 15
  • 30