[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

PHP array to text and back to array

Posted on 2014-02-18
4
Medium Priority
?
537 Views
Last Modified: 2014-02-18
i want to send an entire POST array thru a single (text) API GET param and
process it (remotely in the API)

what is the best way to "encode" or "compress" or "convert" a PHP array into a text string
such that it can be easily  re-constituted back to the original array at the other end.

thanks
0
Comment
Question by:willsherwood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:Gregory Miller
Gregory Miller earned 1000 total points
ID: 39869170
I would use serialization. Here is a link from the PHP manual: http://www.php.net/manual/en/language.oop5.serialization.php
0
 
LVL 58

Accepted Solution

by:
Gary earned 1000 total points
ID: 39869177
How is the array being constructed? In PHP?
You may want to look at json_encode to convert to a string and then in the reverse json_decode to get the string back as an array
0
 

Author Comment

by:willsherwood
ID: 39869196
a POST array is constructed by the web browser i would suppose.
0
 

Author Closing Comment

by:willsherwood
ID: 39869209
both excellent approaches i was not aware of.
thanks!!!
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question