[ php ] json 배열 출력 방식에 따른 차이 > php

본문 바로가기
사이트 내 전체검색

php

[ php ] json 배열 출력 방식에 따른 차이

작성자 웹지기
작성일 18-11-06 18:06 | 조회 11,907 | 댓글 0

본문

$data = array('id' => '88', 'country' => 'Korea', 'brand' => 'Samsung, Sony');

이와같은 값을 json_encode($data); 하면

echo json_encode($data);

다음처럼 출력

{"id":"88","country":"Korea","brand":"Samsung, Sony"} 

 

 

$data = array('88', 'Korea', 'Samsung, Sony');

이와같은 값을 json_encode($data); 하면

echo json_encode($data);

다음처럼 출력

{"88", "Korea", "Samsung, Sony"} 

 

 

0 0

댓글목록 0

등록된 댓글이 없습니다.

php 목록

Total 82
게시물 검색

회원로그인

접속자집계

오늘
18,633
어제
35,111
최대
61,067
전체
18,120,921

그누보드5
Copyright © funyphp.com. All rights reserved.