Serialise

I encountered the term “serialise”. But what does it mean?
I understood the term “serialise” when I read a comment that explained that data structures can be created inside, say, PHP. One may think of an object or an array. Such data structures can only be used inside PHP and they cannot be transported outside PHP. To transport such structures outside, one needs to translate the structure into strings and numerics. PHP has a very convenient function, serialize, that does this for you. In other languages, you have to write your own serialise fundtion whereby you export strings and numerics from an object.

$a= array( 'piet', 'jan', 'klaas');
print_r($a);
$b=serialize($a);
print_r($b);
$c=unserialize($b);
print_r($c);

The output looks like:

Array ( [0] => piet [1] => jan [2] => klaas ) 

a:3:{i:0;s:4:"piet";i:1;s:3:"jan";i:2;s:5:"klaas";}

Array ( [0] => piet [1] => jan [2] => klaas )

The first line shows the PHP representation of an array. The second line shows a string that can be understood by an outside application. After that, the operation is reversed and the original, PHP-internal, representation is provided.