Skip to content
BEAD

PHP serialize / unserialize

Convert between PHP's serialize() format and JSON with a recursive-descent parser.

JSON

Format primer

PHP's serialize() produces a compact, typed text representation: s:N:"…" for strings (length in bytes), i:N for ints, d:N for floats, b:0|1 for booleans, N for null, and a:N:{} for arrays.

Limits

Object instances (O:) and references (r:) are intentionally unsupported — round-tripping them safely requires class definitions we don't have access to.

You might also like