Unserializing a Serialized PHP Value


Convert a serialized string back into a PHP value with unserialize().

Source Code

$serialized = 'a:3:{i:0;s:5:"apple";i:1;s:6:"banana";i:2;s:6:"cherry";}';
$array = unserialize($serialized);
print_r($array); // Outputs the original array
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments