카테고리 없음

json 형식을 보기좋게 변환 하는 사이트 https://jsonformatter.org/

행복을전해요 2020. 4. 5. 21:58

json 형식을 보기좋게 변환 하는 사이트 https://jsonformatter.org/

 

Best JSON Formatter and JSON Validator: Online JSON Formatter

Online JSON Formatter and Online JSON Validator also provides tools to convert JSON to XML, JSON to CSV, JSON Editor, JSONLint , JSON Checker and JSON Cleaner. JSON Formatter Online and JSON Validator Online work well in Windows, Mac, Linux, Chrome, Firefo

jsonformatter.org

 

 

<?php

$json='{ "programmers": [
    { "firstName": "Brett", "lastName":"McLaughlin", "email": "brett@newInstance.com" },
    { "firstName": "Jason", "lastName":"Hunter", "email": "jason@servlets.com" },
    { "firstName": "Elliotte", "lastName":"Harold", "email": "elharo@macfaq.com" }
],
"authors": [
    { "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
    { "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
    { "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
],
"musicians": [
    { "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
    { "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
]
}';

$a=json_decode($json);


//print_r($a);
for($i=0;$i<count($a->authors);$i++){
echo $a->authors[$i]->firstName;
};








 

출력결과. 아직 완벽히는 모르겠다.. 

IsaacTadFrank