How to use php serialize() and unserialize()
<p>My problem is very basic.</p>

<p>I did not find any example to meet my needs as to what exactly serialize() and unserialize() mean in php? They just give an example - serialize an array and show an output in an unexplained format. It is really hard to understand the basic concept going through their jargon.</p>

<p><strong>EDIT:</strong></p>

<pre><code>&lt;?php

$a= array( '1' =&gt; 'elem 1', '2'=&gt; 'elem 2', '3'=&gt;' elem 3');
print_r($a);
echo ("&lt;br&gt;&lt;/br&gt;");
$b=serialize($a);
print_r($b);

?&gt;
</code></pre>

<p>ouput:</p>

<pre><code>Array ( [1] =&gt; elem 1 [2] =&gt; elem 2 [3] =&gt; elem 3 ) 

a:3:{i:1;s:6:"elem 1";i:2;s:6:"elem 2";i:3;s:7:" elem 3";}
</code></pre>

<p>I cannot understand the second output. Besides that, can anyone give an example of a situation that I need to serialize a php array before using it?</p>
