我正在使用 PHP curl 从 URL 获取 Oauth 令牌:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: ' . oauth_headers($consumer_key, $consumer_secret, $token, $token_secret, $verifier)));curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
https://www.yammer.com/oauth/request_token
然后,我通过以下方式得到了回应:
输出
-------
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 10 Oct 2012 10:32:47 GMT
.........
.........
oauth_token=6y33AOcKOJVRVRggumfa9Q&oauth_token_secret=usjLakBRQh3Cq4rTWT1aJe9NVo7XKiATYIWvvVovI&oauth_callback_confirmed=true
我如何从结果中提取oauth_token_secret
和提取oauth_token
?