Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6215881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:08:10+00:00 2026-05-24T07:08:10+00:00

here is a json tree from wikipedia. http://en.wikipedia.org/w/api.php?action=query&titles=japan&prop=categories&format=json I met a trouble in pages:

  • 0

here is a json tree from wikipedia. http://en.wikipedia.org/w/api.php?action=query&titles=japan&prop=categories&format=json

I met a trouble in "pages": { "15573": {. If I will turn the query word, the page number is always changed. How to do a json decode when a child nod is a radom number? Thanks.

{
    "query": {
        "normalized": [
            {
                "from": "japan",
                "to": "Japan"
            }
        ],
        "pages": {
            "15573": {
                "pageid": 15573,
                "ns": 0,
                "title": "Japan",
                "categories": [
                    {
                        "ns": 14,
                        "title": "Category:All articles containing potentially dated statements"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Article Feedback Pilot"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Articles containing Japanese language text"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Articles containing potentially dated statements from 2010"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Articles containing potentially dated statements from January 2011"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Constitutional monarchies"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Countries bordering the Pacific Ocean"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Countries bordering the Philippine Sea"
                    },
                    {
                        "ns": 14,
                        "title": "Category:East Asian countries"
                    },
                    {
                        "ns": 14,
                        "title": "Category:Empires"
                    }
                ]
            }
        }
    },
    "query-continue": {
        "categories": {
            "clcontinue": "15573|Featured articles"
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:08:11+00:00Added an answer on May 24, 2026 at 7:08 am

    You can do this (based on what you want in comment):

    $json_array = json_decode($json, true);
    
    foreach($json_array['query']['pages'] as $page)
    {
        print_r($page['categories']);
    }
    

    I’m assuming you want to access it as array, but you can also do it with the default return value, with little modification of course.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some json from picasaweb: http://picasaweb.google.com/data/feed/api/user/100489095734859091829?kind=album&access=visible&alt=json-in-script&thumbsize=144c Here's the output as tidied up by jsonview -
I'm using cocoa JSON framework http://code.google.com/p/json-framework/ Here is the result of an JSON output
I am using a jQuery Ajax control from this site http://abeautifulsite.net/2008/03/jquery-file-tree/ I have it
Here is an exerpt from the php_decoded JSON structure that I am working with
Here is a json tree. [ {name:foo}, {name:bar}, {name:Hello} ] How to put one
I'd like to create a tree structure from JSON, but with multiple columns that
I am creating a json tree with checkbox using jquery. Here is my code:
I have a method which requests external webservices and returns json here: public string
Here is my Json data: [{ok : false, details : [{n : Email, v
noob Android/JSON person here. I hope someone might help me? I've looked and looked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.