I have a multi dimensional array i want to convert this array to string and saved in to a file.Also need to convert string that stored in the file to the previous array for further processing. (i.e the file is like a table in the database ). Is it possible to convert the array to string and then back to array using php? If anyone knows please help me thanks in advance...
3 Answers
serialize converts a PHP object to a string. unserialize converts that string into whatever it was stored as. Also see __sleep and __wakeup.
Comments
i think you have to loop through this array manually to build your string for your purpose. You can use the php function implode for a onedimensional array.
Read the comments of http://php.net/manual/en/function.implode.php .There is an algorithm to get this done also usinhg the implode function.