$a = new SplDoublyLinkedList;
$arr=[1,2,3,4,5,6,7,8,9];
for($i=0;$i<count($arr);$i++){
$a->add($i,$arr[$i]);
}
$serialize=serialize($a);
echo $serialize;
echo PHP_EOL,PHP_EOL;
$unserialze=unserialize($serialize);
print_r($unserialze);
(PHP 5 >= 5.4.0, PHP 7, PHP 8)
SplDoublyLinkedList::unserialize — Unserializes the storage
$data
): voidUnserializes the storage, from SplDoublyLinkedList::serialize().
本函数还未编写文档,仅有参数列表。
data
The serialized string.
没有返回值。
$a = new SplDoublyLinkedList;
$arr=[1,2,3,4,5,6,7,8,9];
for($i=0;$i<count($arr);$i++){
$a->add($i,$arr[$i]);
}
$serialize=serialize($a);
echo $serialize;
echo PHP_EOL,PHP_EOL;
$unserialze=unserialize($serialize);
print_r($unserialze);