PHP Deserialize

Deserializes PHP serialized data, outputting keyed arrays as JSON.

Input: TextResult: Text

Text input

Tool options

Examples

PHP Deserialize array (JSON)

Input

a:2:{s:1:"a";i:10;i:0;a:1:{s:2:"ab";b:1;}}

Expected answer

JSON
{"a": 10,"0": {"ab": true}}
Output valid JSON
On
PHP Deserialize array (non-JSON)

Input

a:2:{s:1:"a";i:10;i:0;a:1:{s:2:"ab";b:1;}}

Expected answer

{"a": 10,0: {"ab": true}}
Output valid JSON
Off
PHP Deserialize empty array

Input

a:0:{}

Expected answer

JSON
{}
Output valid JSON
On
PHP Deserialize integer

Input

i:10;

Expected answer

JSON
10
Output valid JSON
On
PHP Deserialize string

Input

s:17:"PHP Serialization";

Expected answer

JSON
"PHP Serialization"
Output valid JSON
On

This function does not support object tags. Example: a:2:{s:1:"a";i:10;i:0;a:1:{s:2:"ab";b:1;}} becomes {"a": 10,0: {"ab": true}} Output valid JSON: JSON doesn't support integers as keys, whereas PHP serialization does. Enabling this will cast these integers to strings. This will also escape backslashes.

Parameters

ParameterDefault valueInput and choices
Output valid JSONtrueOn or off

Related tools

Browse code tidy tools