0

Data like:

a:5:{i:0;s:0:"";i:1;s:0:"";s:7:"message";s:0:"";s:5:"medal";N;s:5:"users";s:0:"";}

and what's this datatype?

Cœur
  • 34,719
  • 24
  • 185
  • 251
Wilon
  • 117
  • 1
  • 6

2 Answers2

4

The datatype is a non-standard protocol which exists only within the php-src scripting language.

To properly create a PHP value from a stored representation you would use the unserialize()` function provided by the SPL.

unserialize('a:2:{s:9:"usergroup";s:0:"";s:6:"verify";s:0:"";}');

unserialize() takes a single serialized variable and converts it back into a PHP value.

Ryan
  • 14,053
  • 8
  • 59
  • 102
2

Couldn't have been that hard if you tried

print_r(unserialize('a:2:{s:9:"usergroup";s:0:"";s:6:"verify";s:0:"";}'));

Output:

Array
(
    [usergroup] => 
    [verify] => 
)
Hanky Panky
  • 45,969
  • 8
  • 69
  • 95