[PHP] Flatten/Unflatten arrays

2004-04-19 Thread OrangeHairedBoy
Hi all,

In Perl there is a way to flatten an array into a string, and a matching
function to unflatten the array.

This is different from explode/implode because the function supports
multidimentional arrays as well.

The purpose is to be able to write an array to a flatfile, and when
necessary, read it in and it's in it's original form ready to use.

Are there PHP functions which do the same thing? If not, has anyone ever
written functions to do this?

Thanks!

Lewis

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Flatten/Unflatten arrays

2004-04-19 Thread Chris W. Parker
OrangeHairedBoy mailto:[EMAIL PROTECTED]
on Monday, April 19, 2004 4:23 PM said:

 In Perl there is a way to flatten an array into a string, and a
 matching function to unflatten the array.

i think you're looking for serialize() and unserialize().


http://php.net/serialize
http://php/net/unserialize



chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Flatten/Unflatten arrays

2004-04-19 Thread OrangeHairedBoy
Ah!

THANK YOU THANK YOU THANK YOU!

I was going insane when I couldn't remember the names of the Perl functions
either! :)

Lewis

Chris W. Parker [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
OrangeHairedBoy mailto:[EMAIL PROTECTED]
on Monday, April 19, 2004 4:23 PM said:

 In Perl there is a way to flatten an array into a string, and a
 matching function to unflatten the array.

i think you're looking for serialize() and unserialize().


http://php.net/serialize
http://php/net/unserialize



chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php