vishnu
vishnu

Reputation: 495

Remove quotes from json object

How to remove the quotes from json object:

Using php, i get the data in the following format(display the data using console.log())

[
    ["Catching the Wind in Rural Malawi § SEEDM...", "3"], 
    ["Engineering § SEEDMAGAZINE.COM...", "2"], 
    ["Technology Review India: Nissan's Lea...", "2"], 
    ["Alternative Fuel Consulting & Technical Tr...", "2"], 
    ["MIT OpenCourseWare | Science, Technology, ...", "2"]
]

How to remove the quotes using jquery/json,I need string like this(no quotes around the number):

[
    ["Catching the Wind in Rural Malawi § SEEDM...", 3], 
    ["Engineering § SEEDMAGAZINE.COM...", 2], 
    ["Technology Review India: Nissan's Lea...", 2], 
    ["Alternative Fuel Consulting & Technical Tr...", 2], 
    ["MIT OpenCourseWare | Science, Technology, ...", 2]
]

Upvotes: 0

Views: 1047

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798616

You don't. You parse the JSON, convert them to integers, and then stringify again.

Upvotes: 5

Related Questions