Notice
														
												
											
												
												
													Recent Posts
													
											
												
												
													Recent Comments
													
											
												
												
													Link
													
											
									| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
													Tags
													
											
												
												- 쇼핑몰
 - 안드로이드
 - 쇼핑몰구축
 - jQuery Plugin
 - 웹퍼블리싱
 - 3D프린터
 - JQuery
 - 홈페이지제작
 - 웹디자이너
 - 웹에이전시
 - plugin
 - work6.kr
 - 웹퍼블리셔
 - 홈페이지구축
 - 플러그인
 - 프로그래머
 - 워크식스
 - 고도몰
 - 커스터마이징
 - 쇼핑몰제작
 - 홈페이지
 - 웹디자인
 - CSS
 - 포트폴리오
 - 사이트제작
 - 튜닝
 - PHP
 - 제이쿼리
 - 개발자
 - 웹개발자
 
													Archives
													
											
												
												- Today
 
- Total
 
그냥 개발자 블로그
PHP팀 - post json 데이터 받기 본문
function objectToArray($d) {
if (is_object($d)) {
// Gets the properties of the given object
// with get_object_vars function
$d = get_object_vars($d);
}
if (is_array($d)) {
/*
* Return array converted to object
* Using __FUNCTION__ (Magic constant)
* for recursive call
*/
return array_map(__FUNCTION__, $d);
}
else {
// Return array
return $d;
}
}
$post = json_decode(file_get_contents('php://input'));
$post = objectToArray($post);
echo $post->변수명;
'프로그래밍팁 > php' 카테고리의 다른 글
| 해시태그 추출 정규식 (0) | 2017.05.21 | 
|---|---|
| PHP팁 - 한글 글자수 세기 (0) | 2017.02.19 | 
| PHP팁 - 다중배열 인코딩 한방에 하기 (0) | 2015.10.11 | 
| PHP팁 - 문자열 인덱스 사용법 (stdclass, object) (0) | 2015.10.11 | 
| PHP팁 - 워터마크 붙이기 (0) | 2015.10.08 |