PHP Serializer / Unserializer

Updated: 2026-07-11
Advertisement (Top)

πŸ”„ Operation Mode

πŸ“ Input (PHP Array Format)

Enter data on the left, view result on the right in real-time

Input
Output
Waiting for input...

πŸ“– How to Use

Serialize: Enter a PHP-like array format (e.g. ["name"=>"John", "age"=>28]) to convert it to a PHP serialized string.

Unserialize: Enter a PHP serialized string (e.g. a:2:{s:4:"name";s:4:"John";s:3:"age";i:28;}) to restore it to a readable PHP array format.

Supported types: string, integer, double (float), boolean, null, array, and object.

🎯 Use Cases

❓ FAQ

What is PHP serialization?

PHP serialization converts PHP variables (arrays, objects, etc.) into a storable string format. The serialized string includes type and length information and can be restored using the unserialize() function.

What's the difference between serialization and JSON?

PHP serialization is PHP-specific and supports all PHP data types (including objects and references), but is not cross-language. JSON is a universal format supported by all languages but cannot represent PHP-specific object types and references.

Why does unserialization fail?

Common causes: corrupted serialized string (length mismatch), encoding issues, or the referenced class doesn't exist. Check that the serialized string is complete and intact.

Advertisement (Bottom)