0

This is my object array

 [Object { qe="1-5",  result="0"}, Object { qe="1-5",  result="1"}, Object { qe="8+9",  result="0"}]

and I need to send this array as a href link

something like this :

index.php?mode=result&link= OBJECT

Now I need to know how to convert this specific type of array into string

I have a demo here but not useful:

http://jsfiddle.net/fkling/bchG5/

1
  • I find it funny that you link to a fiddle I created two years ago ;) Commented Mar 23, 2013 at 17:46

2 Answers 2

2

It seems like you can just send it as a JSON string. You can use JSON.stringify on the object:

encodeURIComponent(JSON.stringify(value));

On the php side, json_decode($_REQUEST['link']) will convert it into usable PHP constructs (arrays, objects).

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

Comments

0

try the following

var obj= [Object { qe="1-5",  result="0"}, Object { qe="1-5",  result="1"}, Object { qe="8+9",  result="0"}]
alert(JSON.stringify(obj));

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.