Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP serialize() Function

PHP serialize() Function

PHP Available FunctionsAvailable PHP Functions

serialize() The function is used to serialize an object or array and return a string.

serialize() After serializing an object with the function, it can be easily passed to other places that need it, and its type and structure will not change.

If you want to turn the serialized string back into a PHP value, you can use unserialize().

PHP version requirement: PHP 4, PHP 5, PHP 7

Syntax


string serialize ( mixed $value )

Parameter Description:

Return Value

Returns a string.

Example

Example

The output is:


a:3:{i:0;s:6:"Google";i:1;s:6:"Runoob";i:2;s:8:"Facebook";}

PHP Available FunctionsAvailable PHP Functions