Introduction
The serialize() function of PHP turns a
value into a byte string that records its type and structure, and
unserialize() restores it. The strings turn up in databases, caches and
session stores. The data has no standard file extension; this page is listed as
PHPSER.
Structure
Each value starts with a type letter: for example s:5:"hello"; is a
string, i:42; an integer, N; null, a:2:{…} an
array of two entries, O: an object and E: an enum case. The
string can contain null bytes, which mark private and protected property names.
Not described
This page is a first outline. The details of the format are not yet described here.
Known, not yet covered
- Reference: all the type letters and references, which PHP’s source code defines.
- Viewer: the site has no viewer for this format.
Links
Software
- PHP – the language whose functions write and read the data
Reference
- serialize – PHP manual