1

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...

1
  • Would you please accept some of the answers, will you? Commented Jun 17, 2011 at 8:54

3 Answers 3

2

serialize converts a PHP object to a string. unserialize converts that string into whatever it was stored as. Also see __sleep and __wakeup.

Sign up to request clarification or add additional context in comments.

Comments

1

You can also use the built-in seralize function that will serialize any type of data.

Comments

-1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.