Por
Saiyine
el 2006-10-25 02:50:27 - Secciones: - Enlace permanente: 711
Serialization is the process of converting some object into an easy to manage string, maintaining the ability of inverting the process and obtaining the object back from the string.
So, we could convert database rows into text lines in order to save the changes in a text file, save our program's objects when it ends and recover them at the next run, or create object persistence systems like caches.
With PHP is really easy, because we have the runtime function serialize:
<?
$vector["hola"]="Epa{}";
$vector["electric"]="Head";
print_r($vector);
$temporal=serialize($vector);
echo $temporal."\n";
$matrix=unserialize($temporal);
print_r($matrix);
?>
Output:
Array
(
[hola] => Epa{}
[electric] => Head
)
a:2:{s:4:"hola";s:5:"Epa{}";s:8:"electric";s:4:"Head";}
Array
(
[hola] => Epa{}
[electric] => Head
)
Otras entradas de la web que podrian interesarte:
. . .
. . .
. . .
Varios ejemplos de lo que buscaban visitantes recientes:
. . .
Página web ©2001-2011 Saiyine descargada en s, con 5902538 visitas en total, hoy (de un total de 0 previstas).
. . .