PHP json 파일 읽기

Jmnote (토론 | 기여)님의 2017년 12월 3일 (일) 21:11 판 (새 문서: ==개요== ;PHP JSON 파일 읽기 <source lang='php'> $arr = json_decode(file_get_contents('test.json'), true); </source> ==실행예시== <source lang='console'> root@zetawiki:~# c...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

PHP JSON 파일 읽기
$arr = json_decode(file_get_contents('test.json'), true);

2 실행예시

root@zetawiki:~# cat test.json
{"hello":"world"}
root@zetawiki:~# cat a.php
<?php
$arr = json_decode(file_get_contents('test.json'), true);
print_r($arr);
root@zetawiki:~# php a.php
Array
(
    [hello] => world
)

3 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}