Часть кода где я получаю от cURL данные и в итоге имею переменную $obj с json массивом.
как получить максимальное число из поля [c]?
Буду очень благодарен за ответ, вы будите моим героем))
curl_setopt($ch, CURLOPT_URL, "https://api-domain.com/v3/instruments/" . $ticker . "/candles?&price=A&from=" . $first . "&to=" . $second . "&granularity=D");
// get stringified data/output. See CURLOPT_RETURNTRANSFER
$data = curl_exec($ch);
// get info about the request
$info = curl_getinfo($ch);
// close curl resource to free up system resources
curl_close($ch);
$json_string = $data;
$jsondata = ($json_string);
$obj = json_decode($jsondata,true);
print_r($obj); //below get the answer
Получаю json массив ниже
//(print_r output)
Array
(
[instrument] => EUR_USD
[granularity] => D
[candles] => Array
(
[0] => Array
(
[complete] => 1
[volume] => 32813
[time] => 2017-01-02T22:00:00.000000000Z
[ask] => Array
(
[o] => 1.04711
[h] => 1.04908
[l] => 1.03413
[c] => 1.04061
)
)
[1] => Array
(
[complete] => 1
[volume] => 34501
[time] => 2017-01-03T22:00:00.000000000Z
[ask] => Array
(
[o] => 1.04076
[h] => 1.05009
[l] => 1.03907
[c] => 1.04908
)
)
[2] => Array
(
[complete] => 1
[volume] => 52627
[time] => 2017-01-04T22:00:00.000000000Z
[ask] => Array
(
[o] => 1.04911
[h] => 1.06161
[l] => 1.04816
[c] => 1.06083
)
)
)
)