unserialize

(Supports PHP 4 and above)

unserialize — converts a serialized data to actual data.

unserialize() takes a single serialized variable and converts it back into a PHP value.

Return value

The converted  value can be an array, a boolean, float, integer or string.

Value Type : Mixed*.

*Mixed : Mixed indicates that the return value may multiple (but not necessarily all) types.

Examples

<?php
$data = array();
$data[] = "The";
$data[] = "Quick";
$data[] = "Brown fox";

$serialized_data = serialize($data);
print $serialized_data . "\n";

$unserilalizedData = unserialize($serialized_data);
var_dump($unserilalizedData);
?>; 
//result
array (size=3)
  0 > string 'The' (length=3)
  1 > string 'Quick' (length=5)
  2 > string 'Brown fox' (length=9)

Comments

PHP Unserialize Function

Leave a Reply

Facebook Page

Facebook Page Loading...