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

본문 바로가기

사이트 내 전체검색

php

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

작성일 18-11-06 18:06

페이지 정보

작성자 웹지기 조회 7,793회 댓글 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

댓글목록

등록된 댓글이 없습니다.

전체 82건 1 페이지

이미지 목록

게시물 검색
Copyright © 즐거운 코딩 생활 ( funyphp ). All rights reserved.
PC 버전으로 보기