In PHP, the serialize() function is used to serialize an object or array and return a string containing a byte stream to represent it.
PHP unserialize is the reverse process of serialization, which is the process of converting byte stream into objects.
Using the PHP unserialize online tool we provide, you can test the string before serialization, Or you can also click 'php online compiler' test it .
You can click the 'Example' button to learn how to use it.
We provide the following example to understand how to use PHP deserialization.
<?php
$ser = 'a:3:{s:2:"id";i:1;s:4:"name";s:4:"John";s:3:"age";i:32;}';
$ser = unserialize($ser);
var_dump($ser);
?>
the output:
array(3) {
["id"]=>
int(1)
["name"]=>
string(4) "John"
["age"]=>
int(32)
}