我想从我的数组中得到1天的数据.......我的数组的最后一个值是基数......所以我如何根据最后一个值从我的数组中得到1天的数据
我的数组数据中的将是
[1901] => Array
(
[O] => 0.0107
[H] => 0.0107
[L] => 0.010633
[C] => 0.01064211
[V] => 3018.65504806
[T] => 2017-10-12T20:00:00
[BV] => 32.24689131
)
[1902] => Array
(
[O] => 0.01064211
[H] => 0.01068489
[L] => 0.01063301
[C] => 0.01066111
[V] => 2405.55511401
[T] => 2017-10-12T20:30:00
[BV] => 25.6621846
)
[1903] => Array
(
[O] => 0.01066111
[H] => 0.01068999
[L] => 0.01059881
[C] => 0.01065053
[V] => 2204.80426478
[T] => 2017-10-12T21:00:00
[BV] => 23.49363269
)
[1904] => Array
(
[O] => 0.01064111
[H] => 0.01064111
[L] => 0.010579
[C] => 0.010581
[V] => 5477.34718515
[T] => 2017-10-12T21:30:00
[BV] => 58.14801298
)
[1905] => Array
(
[O] => 0.01060992
[H] => 0.01061999
[L] => 0.01055925
[C] => 0.01055925
[V] => 1295.68313273
[T] => 2017-10-12T22:00:00
[BV] => 13.71553431
)
[1906] => Array
(
[O] => 0.01055379
[H] => 0.01075
[L] => 0.01055379
[C] => 0.01063901
[V] => 4028.03243397
[T] => 2017-10-12T22:30:00
[BV] => 42.91348706
)
[1907] => Array
(
[O] => 0.0106396
[H] => 0.01086255
[L] => 0.01062403
[C] => 0.01086254
[V] => 5970.34358887
[T] => 2017-10-12T23:00:00
[BV] => 64.443243
)
[1908] => Array
(
[O] => 0.01085198
[H] => 0.01100069
[L] => 0.0108152
[C] => 0.011
[V] => 8098.45644072
[T] => 2017-10-12T23:30:00
[BV] => 88.32484248
)
[1909] => Array
(
[O] => 0.011
[H] => 0.01108273
[L] => 0.01079463
[C] => 0.01097
[V] => 9552.72246121
[T] => 2017-10-13T00:00:00
[BV] => 104.53520674
)
[1910] => Array
(
[O] => 0.01097
[H] => 0.01099792
[L] => 0.01068543
[C] => 0.01070002
[V] => 6717.53764236
[T] => 2017-10-13T00:30:00
[BV] => 72.71144062
)
[1911] => Array
(
[O] => 0.01070002
[H] => 0.01084719
[L] => 0.01067137
[C] => 0.01077005
[V] => 3795.38947434
[T] => 2017-10-13T01:00:00
[BV] => 40.8931196
)
[1912] => Array
(
[O] => 0.01082149
[H] => 0.01096
[L] => 0.01077005
[C] => 0.01089
[V] => 7928.74130914
[T] => 2017-10-13T01:30:00
[BV] => 86.28752227
)
[1913] => Array
(
[O] => 0.01089869
[H] => 0.0109
[L] => 0.01054
[C] => 0.01056426
[V] => 6724.34568968
[T] => 2017-10-13T02:00:00
[BV] => 71.98063356
)
[1914] => Array
(
[O] => 0.01056672
[H] => 0.01057
[L] => 0.00993751
[C] => 0.01019941
[V] => 11290.1350477
[T] => 2017-10-13T02:30:00
[BV] => 115.27891267
)
[1915] => Array
(
[O] => 0.0102203
[H] => 0.0104
[L] => 0.0100707
[C] => 0.010122
[V] => 7113.91285039
[T] => 2017-10-13T03:00:00
[BV] => 72.44417974
)
[1916] => Array
(
[O] => 0.010122
[H] => 0.01024499
[L] => 0.01
[C] => 0.01005709
[V] => 4658.85947034
[T] => 2017-10-13T03:30:00
[BV] => 47.03048392
)
[1917] => Array
(
[O] => 0.0100098
[H] => 0.0100777
[L] => 0.00993305
[C] => 0.009935
[V] => 3072.15120211
[T] => 2017-10-13T04:00:00
[BV] => 30.70267092
)
[1918] => Array
(
[O] => 0.0099549
[H] => 0.01002697
[L] => 0.00989463
[C] => 0.00994699
[V] => 6147.17825038
[T] => 2017-10-13T04:30:00
[BV] => 60.98741912
)
[1919] => Array
(
[O] => 0.00994167
[H] => 0.009971
[L] => 0.00981
[C] => 0.009871
[V] => 1369.64657292
[T] => 2017-10-13T05:00:00
[BV] => 13.524158
)
在我的数组中,最后一个值是" T" = 2017-10-13T05:00:00
但我希望在1天之前得到数据 像最后一个值是2017-10-13T05:00:00我想从2017-10-12T05:00:00到2017-10-13T05:00:00获取数据我怎么能这样做,我的主阵列名称是结果..... !!
我试过这段代码
<?php
$url2 = 'https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-LTC&tickInterval=thirtyMin';
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_URL,$url2);
$result2=curl_exec($ch2);
curl_close($ch2);
$a2 = json_decode($result2, true);
$b2 = $a2['result'];
for($i=0; $i<count($b2);$i++){
$c = $b2[$i];
$bi1 = $c['H'];
$bi2 = $c['L'];
$bi3 = $c['O'];
$bi4 = $c['C'];
$bi5 = $c['T'];
//echo $bi5;
//echo "<br>";
//echo $stop_date = date('Y-m-d H:i:s', strtotime($bi5. ' -1 day'));
//echo "<br>";
echo $stop_date = date('Y-m-d H:i:s', strtotime($bi5. ' -30 min'));
echo "<br>";
}
?>