RobMichaelson Posted January 27, 2013 Share Posted January 27, 2013 Hello I have been working really hard on getting an API (184.173.18.228/api/profile/1000/0/Adam.Adams) to display anything and it worked with $json_output = json_decode($json); <?php $url = "http://184.173.18.228/api/profile/1000/0/Adam.Adams"; $json = file_get_contents($url, 0, null, null); $json_output = json_decode($json); echo '<pre>'; print_r("query results:"); print_r($json_output); '</pre>'; $obj = array('section', 'fname', 'lname'); var_dump($obj) ?> when I uploaded the php file and view it in browser - it looked like an array ( a lot more than displayed here)- stdClass Object ( [ProfileSections] => Array ( [0] => stdClass Object ( [sectionType] => ContactCard [sections] => Array ( [0] => stdClass Object ( [ContentType] => ProfileBio [Title] => [Description] => my next quest is to get this array into html that I can style - I am soooo stuck - do I save the array as a file then call the file to display? can take this output before it gets displayed in the browser with stylized output? thanks Rob Quote Link to comment https://forums.phpfreaks.com/topic/273698-json_decode-outputs-array-that-i-want-into-html-tables/ Share on other sites More sharing options...
Muddy_Funster Posted January 29, 2013 Share Posted January 29, 2013 it's not just an array, it's a combination of objects and arrays. You can manipulate and stylise these as you would any other object or array values before doing any output. Quote Link to comment https://forums.phpfreaks.com/topic/273698-json_decode-outputs-array-that-i-want-into-html-tables/#findComment-1408918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.