Serialize is a function which is used to convert a storable representation of a value. It converts an array into string containing a byte stream representation of a value.
<?php
$serializeddata = serialize(array('apple', 'mango', 'banana'));
echo $serializeddata . '<br>';
?>
Unserialize is a function which converts the actual data from serialized data. it is just the opposite of serialize function. It converts string back to array.
<?php
// Unserialize the data
$var1 = unserialize($serialized_data);
var_dump ($var1);
?>
0 Comment(s)