note 61700 deleted from function.unserialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 01:27:16 +0000 |
| Subject: | note 61700 deleted from function.unserialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191699@lists.php.net to get a copy of this message | ||
Note Submitter: onuryerlikaya at hotmail dot com
----
<?php
// Create your array()
$array = array("First","Second","Third");
// Create your package
$package = serialize($array);
// You can print your serialized package
// a:3:{i:0;s:5:"First";i:1;s:6:"Second";i:2;s:5:"Third";}
print $package."<br>";
// Unserialize your serialized package with print_r or var_dump
$data = unserialize($package);
print_r($data);
// var_dump($data); // It's same as print_r
// Array ( [0] => First [1] => Second [2] => Third )
?>