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 9319603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:25:34+00:00 2026-06-19T03:25:34+00:00

I have some data which was json decoded and looks like this: stdClass Object

  • 0

I have some data which was json decoded and looks like this:

stdClass Object
(
    [6] => stdClass Object
        (
            [13] => stdClass Object
                (
                    [buildingId] => 1
                )

        )

    [8] => stdClass Object
        (
            [20] => stdClass Object
                (
                    [Id] => 1
                )

        )

Thing is i don’t know how to loop to get the information to use it in my script.

I need to get for example:

$key, $innerkey, $Id = 1
Object [8][20].Id = 1

The two numbers are X;Y co ordinates so its important i get those values aswell as the id.

I managed to get the first key:

$obj = JSON_decode($_GET['data']);  
    foreach($obj as $key) { 
        echo $key;                      
    }

How do i get the innerkey assigned to a variable ?

  • 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-06-19T03:25:35+00:00Added an answer on June 19, 2026 at 3:25 am

    Change json_decode($_GET['data']); to json_decode($_GET['data'], true);

    If the second parameter is true then it return the array else it is object.

    $obj = json_decode($_GET['data'], true);  
        foreach($obj as $key=>$val) { 
            foreach($val as $k=>$v){
               echo $k." : ".$v['Id'];
               echo "<br>";
            }                      
        }
    

    Ref: http://php.net/manual/en/function.json-decode.php

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

Sidebar

Related Questions

I have some JSON Data which looks like this: { response:{ _token:StringValue, code:OK, user:{
I have some data in JSON format which looks like this: {YrMonth:201109,StrYrMonth:Sep-2011,Value:49275.14} {YrMonth:201110,StrYrMonth:Oct-2011,Value:52087.22} etc...
I have some JSON which looks generally like this... {appJSON: [ { title:Application Title,
I am having trouble getting some data from a JSON object which I have
I have a REST api which dumps some json data (user info, etc). Now
I have some data which look like that: PMID- 19587274 OWN - NLM DP
I receive a post request from client. This request contains some json data which
I have some Json like data got crawling a URL [[[oppl.lr,[,,,,,,,,,,,[[[[[,A Google User] ,,,,1]
I have some data which we transformed into json so it can be imported
I have some JSON data which is in the following format: [ { id:

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.