Jump to content

Export Array Contents in String Then Read Into Array Later

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
rsnider19

rsnider19

    Learning Programmer

  • Members
  • PipPipPip
  • 34 posts
Basically I have an array that I want to store into a database field and be able to read it back into an array at a later time. Like export it as a string that I can later use to setup the array again. I don't want to have to format the string myself if I can help it. I can think of brute force ways of doing it, but I was wondering if there was a way php could do it.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
PHP provides serialize() and unserialize() to handle any serialization of data types (except for resource) to be stored in a flatfile or database.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
rsnider19

rsnider19

    Learning Programmer

  • Members
  • PipPipPip
  • 34 posts
Perfect. Exactly what I need. Thanks mate.

#4
pollock

pollock

    Newbie

  • Members
  • Pip
  • 1 posts
I am also professional php developer.Yes nullworm tell to right php provides serialize() and unserialize() to handle any serialization of data types be stored in a flat file or database. php can later use to setup the array again.