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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:20:35+00:00 2026-06-09T13:20:35+00:00

I have the following code: $url = http://myserver/myapp/restapi.php?method=get_list; $jsondata = curl($url); print_r($jsondata); $arrayObjects =

  • 0

I have the following code:

$url = "http://myserver/myapp/restapi.php?method=get_list";
$jsondata = curl($url);
print_r($jsondata);
$arrayObjects = json_decode($jsondata, true);
print_r($arrayObjects);

The print out of $jsondata works… but the arrayObjects doesn’t print anything.
Ive included just the first “record” of the json data that does get dumped properly:

{"263":{"realm":"object","etags":
 [],"id":"263","name":"ddd","label":"","asset_no":null,"objtype_id":"4",
 "r_id":null,"R_name":null,"row_id":null,"Row_name":null,"container_id":null,
 "container_name":null,"has_problems":"no","comment":null,"nports":"3",
 "runs8021Q":"1","itags":[],"dname":"ddd","atags":[{"tag":"$id_263"},
{"tag":"$typeid_4"},{"tag":"$any_object"},{"tag":"$cn_ddd"},{"tag":"$unmounted"},  
 {"tag":"$no_asset_tag"},{"tag":"$runs_8Q"},{"tag":"$untagged"}]}
 },

i’m not getting any error messages displayed on the screen either.
what i did to try to troubleshoot it is to create a new php file that has this json data in it as a string… and then i called json decode. it works fine. check out the code below:

  <?php

   $jsondata='{"263":{"realm":"object","etags":  
   [],"id":"263","name":"ddd","label":"","asset_no":null,
   "objtype_id":"4","r_id":null,"R_name":null,"row_id":null,
   "Row_name":null,"container_id":null,"container_name":null,
    "has_problems":"no","comment":null,"nports":"3","runs8021Q":"1","itags":     
    [],"dname":"ddd","atags":[{"tag":"$id_263"},
   {"tag":"$typeid_4"},
   {"tag":"$any_object"},{"tag":"$cn_ddd"},{"tag":"$unmounted"},  
   {"tag":"$no_asset_tag"},{"tag":"$runs_8021Q"},{"tag":"$untagged"}]},"187":
   {"realm":"object","etags":[],"id":"187","name":"a-ds-NSM-1",
   "label":"","asset_no":null,"objtype_id":"4","r_id":null,
   "R_name":null,"row_id":null,"Row_name":null,"container_id":null,
   "container_name":null,"has_problems":"no","comment":null,
   "nports":"3","runs8021Q":null,"itags":[],
   "dname":"ss-a-NSM-1","atags":[{"tag":"$id_187"},{"tag":"$typeid_4"},    
   {"tag":"$any_object"},{"tag":"$cn_ss-ds-1"},{"tag":"$unmounted"},   
   {"tag":"$no_asset_tag"},{"tag":"$untagged"}]},
   "123":{"realm":"object","etags":
    [],"id":"123","name":"df","label":"","asset_no":null,
    "objtype_id":"4","r_id":null,"R_name":null,"row_id":null,
   "Row_name":null,"container_id":null,"container_name":null,
   "has_problems":"no","comment":null,"nports":"3",
     "runs8021Q":null,"itags":[],"dname":"df",
    "atags":[{"tag":"$id_123"},{"tag":"$typeid_4"},
      {"tag":"$any_object"},{"tag":"$cn_df"},
   {"tag":"$unmounted"},{"tag":"$no_asset_tag"},{"tag":"$untagged"}]}}';


 print_r(json_decode($jsondata,true));
 ?>

any ideas on what’s wrong with my code would be appreciated.

  • 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-09T13:20:36+00:00Added an answer on June 9, 2026 at 1:20 pm

    The print out of $jsondata works… but the arrayObjects doesn’t print anything.

    That probably means the JSON string is invalid. Make sure you have error_reporting on and display_errors = ON so you can see the error. You can also check your PHP error log for the problem.

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

Sidebar

Related Questions

So I have the following code: NSURL *baseURL = [NSURL URLWithString:@http://www.baseurltoanxmlpage.com]; NSURL *url =
I have the following code in my .Zshrc function google; { $VIEW http://www.google.com/search?q='url-encode ${(j:
I have following code for loading image from url in xml parsing endElement method
I have the following code: $.ajax({ async: false, url: 'chart_data.php', data: {'option':'high', 'id':id}, dataType:
I have a URL string in the following format. http://myserver.com/_layouts/feed.aspx?xsl=4&amp;web=%2F&amp;page=dda3fd10-c776-4d69-8c55-2f1c74b343e2&amp;wp=476f174a-82df-4611-a3df-e13255d97533 I want to replace
I have the following line of PHP code which works great: exec( 'wget http://www.mydomain.com/u1.php
I have written down the following code: var url = http://maps.googleapis.com/maps/api/geocode/json?latlng=+position.coords.latitude+,+position.coords.longitude+&sensor=false&callback=parseMe; console.log('URL is --
i have used following code in my c# application string verification_url = @http://site.com/posttest.php?; string
I have following ajax call in my JavaScript code url = 'http://news.ycombinator.com/?callback=?'; $.ajax({url:url ,async:!1,dataType:'script',
Hi guys i have the following code $.ajax({ url: http://localhost/twee/chat/getnumcom, type: 'POST', data: form_data,

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.