0

I got an object in below format from back end;

Array ([one] => [two] => 1000)

I want this in JSON format, How can I convert? I'm using online JSON parser. unfortunately it failed to do the job.

sujith karivelil
  • 28,671
  • 6
  • 55
  • 88
Surya Raj M
  • 988
  • 1
  • 10
  • 20

2 Answers2

2

You can use PHP to convert your array to JSON

<?php json_encode(your_array); ?>

while sending the code from PHP side and convert back to array at the client side using

JSON.parse(response);
1

you can use php to convert your array to json

<?php json_encode(your_array); ?>
Reuben Gomes
  • 878
  • 9
  • 16