<./>.dev./hood


{"channel":"set1","category":"기타","set":"10401" ,"name":"이름값","status":"ON" } 
{"channel":"set2","category":"게임","set":"10402" ,"name":"이름값","status":"ON" } 
{"channel":"set3","category":"유머","set":"10402" ,"name":"이름값","status":"ON" } 
{"channel":"set4","category":"시사","set":"10403" ,"name":"이름값","status":"ON" } 
{"channel":"set5","category":"기타","set":"10404" ,"name":"이름값","status":"ON" } 
{"channel":"set6","category":"기타","set":"10405" ,"name":"이름값","status":"ON" } 


이렇게 , 구분 없이 단순 스트링으로 출력이 될 때




json_decode( '[' . preg_replace('/}(?=.)/', '},', $json) . ']');



이렇게 출력 해주면 된다...

'Server Side > PHP' 카테고리의 다른 글

php 소괄호 {} 이용 이유  (0) 2017.09.26
while array list each  (0) 2017.08.03
날짜를 배열로 뽑기  (0) 2017.04.05
while 대신 for 로 갯수 제한해서 뽑기  (0) 2017.04.01
PHP 함수 리턴을 배열로 받기  (0) 2017.04.01