Jump to content

Recommended Posts

Hi im just wondering how you get a requested array into a single string then pop it into the db so far i got

print_r($_REQUEST['choice_name']);

 

whch echos

 

Array ( [0] => Colour=Blue [1] => Size=8 [2] => Neck Line=V )

 

I need it to look ready to enter into a db in a single field like this

 

Colour=Blue Size=8 Neck Line=V

 

Any ideas

... did you use it right.

 

this can store a textual representaion of an array (or any object), that can then be unserialized and turned back into the array. Unserializing objects is rather slow however, so be aware of that. alternatively, I suppose you could use json_encode/decode

Are you trying to store the array as a string, and then retrieve it at a later stage and then resotre it back to an array?

 

If so mikesta is correct, you should serialize() and unserialize() your string.

 

 

The reason I ask this is I find it hard to believe you can store useful information in the format you have specified, perhaps you could justify your requirements a bit more so we can offer an appropriate solution.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.