|
Posted by Captain Paralytic on 10/01/07 11:41
On 1 Oct, 12:08, Bruno Barros <rage...@gmail.com> wrote:
> > > I was wondering how to save PHP variables to a txt file and then
> > > retrieve them again.
>
> This is obviously serialize, as it's the easiest way of doing this
> work:
>
> $stuff_to_store = serialize($myvariable);
>
> $handle = fopen('file.txt','w+');
> fwrite($handle, $stuff_to_store);
>
> ---
>
> $stuff_i_stored = unserialize(file_get_contents('file.txt'));
>
> ;)
Could var_export do something similar?
Navigation:
[Reply to this message]
|