Current location: Hot Scripts Forums » General Web Coding » JavaScript » New to JSON - Coding Help


New to JSON - Coding Help

Reply
  #1 (permalink)  
Old 08-12-11, 08:26 PM
faile486 faile486 is offline
New Member
 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
New to JSON - Coding Help

I'm using cURL to pull some information from the Etsy API, and I *think* it's returning JSON information?

Here's a sample of the return:

{
"count": 4,
"results": [
{
"listing_id": 61971249,
"state": "active",
"user_id": 10780231,

My question is, how do I turn this into something useful? One of the values returned is the listing's URL, and I want to take that and turn it into a link. I'm honestly not even sure where to start - can this be stored in variables, can I use PHP to process it?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 08-15-11, 09:39 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Yes, that's JSON. If you're pulling this data using cURL, I think converting it with PHP would be most appropriate. You can use the json_decode function for that. It'll convert it to a regular array, which you can use like this: $data['count'], $data['results'], etc...
Reply With Quote
Reply

Bookmarks

Tags
api, coding, etsy, json, php


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a help regarding an error in my PHP coding heshlive PHP 1 07-04-11 04:55 AM
prolem loading values to my json store kirangentlebreeze1987 JavaScript 0 03-18-11 02:13 AM
Anyone knows JSON? How to Use javascript in SMARTY template system. iantanchan JavaScript 8 04-28-09 01:16 PM
Need website design or HTML coding help? website_help HTML/XHTML/XML 0 05-26-05 12:07 PM
PHP Coding Tips netbakers PHP 1 05-02-05 03:33 AM


All times are GMT -5. The time now is 02:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.