PHP serialize / unserialize

PHP serialization[1] is a process that converts a PHP value into a storable representation. This is particularly useful when you need to store or pass PHP values around without losing their type and structure. The serialize() function in PHP returns a string containing a byte-stream representation of any value that can be stored in PHP. You can store this string or pass it to another script, and then recreate the original variable using the unserialize() function. However, caution must be taken while using unserialize() as it can be a potential security risk if the input is not trusted. It's important to validate and sanitize all data before unserialization.

Limitations of implementation

Serialization and deserialization of custom PHP classes is not supported.

Sources:
[1] en.wikipedia.org/wiki/PHP_serialization_format


Choose from 127 ops
Latest ops 0
Favorite ops 0
Calculations
0