<?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, $is_post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = array();
$response = curl_exec ($ch);
//json 형식으로 넘어온 $response를 decode하기
$obj=json_decode($response,true);
$token = $obj['access_token']; //$response에서 access_token만 꺼내쓰기
echo $token;
?>
JSON
- php curl > json response 받아서 꺼내쓰기 2022.02.08
php curl > json response 받아서 꺼내쓰기
2022. 2. 8. 14:04