$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)
SplDoublyLinkedList::unserialize — Unserializes the storage
$serialized
)Unserializes the storage, from SplDoublyLinkedList::serialize().
이 함수는 현재 문서화 되어있지 않습니다; 인수 목록만을 제공합니다.
serialized
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);