PHP unserialize() 함수
예시
직렬화된 데이터를 다시 실제 데이터로 변환:
<?php
$data = serialize(array("Red", "Green", "Blue"));
echo $data
. "<br>";
$test = unserialize($data);
var_dump($test);
?>
정의 및 사용
unserialize() 함수는 직렬화된 데이터를 다시 실제 데이터로 변환합니다.
통사론
unserialize(string, options);
매개변수 값
Parameter | Description |
---|---|
string | Required. Specifies the serialized string |
options | Optional. Specifies options to be provided to the function, as an associative array. Can be either an array of class names which should be accepted, false to accept no classes, or true to accept all classes. True is default. |
기술적 세부 사항
반환 값: | 변환된 값입니다. 부울, 정수, 부동 소수점, 문자열, 배열 또는 개체일 수 있습니다. FALSE, 실패 시 E_NOTICE |
---|---|
반환 유형: | 부울, 정수, 부동 소수점, 문자열, 배열 또는 객체 |
PHP 버전: | 4.0+ |
PHP 변경 로그: | PHP 7.0: 옵션 매개변수 추가 |
❮ PHP 변수 처리 참조