07-15-2009, 01:48 AM
|
#2 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
It's basically the representation of an array as a string. Good for storing the contents of an array in a file, and then being able to rebuild it with ease.
Take the following as a good example. Here we're saving the array, and then reloading it. It will give us the array just how we had it when we created it initially.
php Code:
function TalkPHP_Array_Save ($aMyArray){ $szSerialize = serialize($aMyArray); file_put_contents ('myArray.txt', $szSerialize); }function TalkPHP_Array_Load (){ $szSerialize = file_get_contents('myArray.txt'); return unserialize($szSerialize); }$aFruit = array('Orange', 'Apple', 'Banana'); /* Save and unset the array. */TalkPHP_Array_Save ($aFruit); unset($aFruit); /* Reload the array from a serialized string. */$aFruit = TalkPHP_Array_Load (); print_r($aFruit);
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|