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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:31:08+00:00 2026-06-16T16:31:08+00:00

I am very new to JSON and i really need help. So I have

  • 0

I am very new to JSON and i really need help. So I have been given this $oldAuctions object and after using PHP’s json_decode function (json_decode($oldAuctions, TRUE);) it returned me something like this that has 11 objects with 9 set of name/value pairs in each…

{
    "recent_results": [
        {
            "closing_yield": "0.800",
            "auction_id": "106",
            "use_buy_it": "0",
            "issuer": "National Bank",
            "term": "1 Year",
            "is_charity": "1",
            "end_date": "12-26-2012",
            "closing_price": "100.000000",
            "issue_type": "FDICs"
        },
        {
            "closing_yield": "1.090",
            "auction_id": "339",
            "use_buy_it": "0",
            "issuer": "National Bank",
            "term": "1 Year",
            "is_charity": "1",
            "end_date": "12-12-2012",
            "closing_price": "100.000000",
            "issue_type": "FDICs"
        },
        {
            "closing_yield": "2.000",
            "auction_id": "041",
            "use_buy_it": "0",
            "issuer": "National Bank",
            "term": "5 Year",
            "is_charity": "1",
            "end_date": "09-11-2012",
            "closing_price": "100.000000",
            "issue_type": "FDICs"
        }
    ]
}

Now I need to grab each pair and save their values in an array. For example, I want to grab the auction_id and save it’s values in an array…..how can I do that?

Also, just for simple testing purpose I tried to print out the values first…but that didn’t work either…

foreach($oldAuctions as $IDs)       
{
   echo 'Ids: '.$IDs->auction_id;
}

I would really appreciate your help. Thank you!

  • 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-16T16:31:09+00:00Added an answer on June 16, 2026 at 4:31 pm

    After invoking json_encode your array $oldAuctions has become a JSON string. You can not iterate through it as array or object as its a string.

    As $oldAuctions is already an array you can simply use forach

    foreach($oldAuctions['recent_results'] as $result){
        echo 'Ids: '.$result['auction_id']. "\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to Python. I have a JSON response like this : {
I am really new to Javascript and Json and need help with the following.
I am very much new to this JSON objects. So I need some helps
I am very new to Python and I have a json news feed that
Very new to python and can't understand why this isn't working. I have a
I'm very new to JSON, and I need to parse some that an API
I am very new to webApp design and have entered this competition in school
i am very new to play with JSON. I need to iterate over JSON
I am very new with ios dev and I have been struggling with almost
so I am new to JSON, and have been experimenting around with some possibilities.

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.