· 6 years ago · Oct 04, 2019, 11:34 AM
1curl_setopt($ch, CURLOPT_HTTPHEADER, [
2 "Authorization: OAuth oauth_consumer_key=" . $oauth_consumerKey . ", oauth_nonce=" . $oauth_nonce . ", oauth_signature=" . $oauth_signature .", oauth_signature_method=\"PLAINTEXT\", oauth_timestamp=" . $oauth_timestamp . ", oauth_token=" . $oauth_token . ", oauth_version=\"1.0\"",
3 ]
4);
5
6// Send the request & save response to $resp
7$resp = curl_exec($ch);
8$jsonResp = json_decode($resp, true);
9
10$eachSensor = $jsonResp["sensor"];
11
12// Close request
13curl_close($ch);
14
15
16foreach ($eachSensor as $key => $sensor) {
17
18echo $key ; ?>
19
20<?php } ?>