Serialize

(Support PHP 4 and above)

serialize — the serialize function will convert the given parameter (usually an array) into a normal string that can be saved in a file, pass as a URL variable, etc. It is very useful to store or pass PHP values around without losing their actual type and structure.

Examples

<?php
$data = array();
$data[] = "The";
$data[] = "Quick";
$data[] = "Brown fox";

$serialized_data = serialize($data);
print $serialized_data . "\n";
?>
//result
a:3:{i:0;s:3:”The”;i:1;s:5:”Quick”;i:2;s:9:”Brown fox”;}

Comments

PHP serialize Function

Leave a Reply

Facebook Page

Facebook Page Loading...