1$ch = curl_init();
2// IMPORTANT: the below line is a security risk, read https://paragonie.com/blog/2017/10/certainty-automated-cacert-pem-management-for-php-software
3// in most cases, you should set it to true
4curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
5curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
6curl_setopt($ch, CURLOPT_URL, 'url_here');
7$result = curl_exec($ch);
8curl_close($ch);
9
10$obj = json_decode($result);
11echo $obj->access_token;