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
  • 37,241
  • 25
  • 195
  • 267
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,392
  • 8
  • 62
  • 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
  • 46,730
  • 8
  • 72
  • 95