"Clark" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Two questions:
>
> 1) Is it possible to write an array to a file?
What about using WDDX, an open XML-format for interchanging
data (see http://www.openwddx.org/) ?
You then will be able to do this:
<?php
$c = array("blue", "orange", "violet");
$f = fopen("MyFile.wddx", "w");
fwrite($f, wddx_serialize_vars("c"));
fclose($f);
?>
To unserialize:
<?php
$fname = "MyFile.wddx";
$f = fopen($fname, "rb");
$packet = fread($f, filesize($fname));
$c = wddx_deserialize($packet);
fclose($f);
?>
> 2) Is it possible to specify the name of the key to each item of an array
> when you get the array using file().
Yep, you'll get the same array back...
--
Christian Blichmann
_____________________________________________
don't hesitate - email me with your thoughts:
e-mail: [EMAIL PROTECTED]
- please remove the ".nospam" from address.
_____________________________________________
do you want to know more?
web: http://www.blichmann.de
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php