1
{ "admin": { "FNAME": "System", "LNAME": "Administrator", "PACKAGE": "default", "WEB_TEMPLATE": "default", "BACKEND_TEMPLATE": "", "PROXY_TEMPLATE": "default", "DNS_TEMPLATE": "default", "WEB_DOMAINS": "unlimited", "WEB_ALIASES": "unlimited", "DNS_DOMAINS": "unlimited", "DNS_RECORDS": "unlimited", "MAIL_DOMAINS": "unlimited", "MAIL_ACCOUNTS": "unlimited", "DATABASES": "unlimited", "CRON_JOBS": "unlimited", "DISK_QUOTA": "unlimited", "BANDWIDTH": "unlimited", "NS": "ns1.clark-chen.com,ns2.clark-chen.com", "SHELL": "sh", "BACKUPS": "3", "CONTACT": "[email protected]", "CRON_REPORTS": "yes", "RKEY": "moEzAxtO9j", "SUSPENDED": "no", "SUSPENDED_USERS": "0", "SUSPENDED_WEB": "0", "SUSPENDED_DNS": "0", "SUSPENDED_MAIL": "0", "SUSPENDED_DB": "0", "SUSPENDED_CRON": "0", "IP_AVAIL": "2", "IP_OWNED": "2", "U_USERS": "24", "U_DISK": "1694", "U_DISK_DIRS": "235", "U_DISK_WEB": "1255", "U_DISK_MAIL": "1", "U_DISK_DB": "203", "U_BANDWIDTH": "1932", "U_WEB_DOMAINS": "14", "U_WEB_SSL": "7", "U_WEB_ALIASES": "19", "U_DNS_DOMAINS": "1", "U_DNS_RECORDS": "11", "U_MAIL_DOMAINS": "5", "U_MAIL_DKIM": "4", "U_MAIL_ACCOUNTS": "1", "U_DATABASES": "9", "U_CRON_JOBS": "8", "U_BACKUPS": "3", "LANGUAGE": "tw", "TIME": "01:02:56", "DATE": "2015-11-15" }, "test": { "FNAME": "test", "LNAME": "test2", "PACKAGE": "default", "WEB_TEMPLATE": "default", "BACKEND_TEMPLATE": "", "PROXY_TEMPLATE": "default", "DNS_TEMPLATE": "default", "WEB_DOMAINS": "unlimited", "WEB_ALIASES": "unlimited", "DNS_DOMAINS": "unlimited", "DNS_RECORDS": "unlimited", "MAIL_DOMAINS": "unlimited", "MAIL_ACCOUNTS": "unlimited", "DATABASES": "unlimited", "CRON_JOBS": "unlimited", "DISK_QUOTA": "unlimited", "BANDWIDTH": "unlimited", "NS": "ns1.example.com,ns2.example.com", "SHELL": "nologin", "BACKUPS": "3", "CONTACT": "[email protected]", "CRON_REPORTS": "yes", "RKEY": "vsZH3vrZsJ", "SUSPENDED": "no", "SUSPENDED_USERS": "0", "SUSPENDED_WEB": "0", "SUSPENDED_DNS": "0", "SUSPENDED_MAIL": "0", "SUSPENDED_DB": "0", "SUSPENDED_CRON": "0", "IP_AVAIL": "2", "IP_OWNED": "0", "U_USERS": "0", "U_DISK": "32", "U_DISK_DIRS": "1", "U_DISK_WEB": "29", "U_DISK_MAIL": "0", "U_DISK_DB": "2", "U_BANDWIDTH": "22", "U_WEB_DOMAINS": "2", "U_WEB_SSL": "0", "U_WEB_ALIASES": "2", "U_DNS_DOMAINS": "2", "U_DNS_RECORDS": "18", "U_MAIL_DOMAINS": "0", "U_MAIL_DKIM": "0", "U_MAIL_ACCOUNTS": "0", "U_DATABASES": "2", "U_CRON_JOBS": "0", "U_BACKUPS": "3", "LANGUAGE": "en", "TIME": "10:45:07", "DATE": "2015-07-20" }}`

`I need help on display those JSON data on either php or HTML, I just need it to be easy to look.

1
  • remove the ` in your JSON Commented Dec 5, 2015 at 2:59

3 Answers 3

1

You can do something like this:

// here $json is your json data
$arr = json_decode($json, true);
foreach($arr as $a){
    foreach($a as $key => $value){
        echo $key . " : " . $value . "<br />";
    }
}
Sign up to request clarification or add additional context in comments.

Comments

1

This would work too, if you dont mind showing the "Array" words:

$array = json_decode($json, true);
print '<pre>';
print_r($array);
print '</pre>';

Output:

Array
(
    [admin] => Array
    (
        [FNAME] => System
        [LNAME] => Administrator
        ...
        [TIME] => 01:02:56
        [DATE] => 2015-11-15
    )

    [test] => Array
    (
        [FNAME] => test
        [LNAME] => test2
        ...
        [TIME] => 10:45:07
        [DATE] => 2015-07-20
    )

) 

Comments

0

Valid your JSON in http://jsonlint.com/

Or in http://jsonviewer.stack.hu/ you can validate your json and have a view in the viewer.

Also,there is a plugin named JSONViewer in chrome webstore or JSONView addon in firefox. By simply echoing the JSON and then there will be a page that you could view JSON documents in the browser.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.