Current Location: Home> Function Categories> serialize

serialize

Generate a representation of a storable value
Name:serialize
Category:Variable processing
Programming Language:php
One-line Description:Converts values ​​to storable representations.

Definition and usage

The serialize() function generates a storeable representation of the value.

This helps store or pass the value of PHP without losing its type and structure.

To convert the serialized string back to the value of PHP, use unserialize() .

Example

Convert values ​​to storable representations:

 <?php
$data = serialize ( array ( "Red" , "Green" , "Blue" ) ) ;
echo $data ;
?>

Try it yourself

grammar

 serialize ( value ) ;
parameter describe
value Required. Specifies the value to be serialized.