-
Notifications
You must be signed in to change notification settings - Fork 0
/
deleteme.php
60 lines (44 loc) · 1.06 KB
/
deleteme.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include 'dbc.php';
include 'getWeather.php';
// get weather
/*
$weather = getWeather('30126');
$string = '{"foo": "bar", "cool": "attr"}';
$result = json_decode($string);
// Result: object(stdClass)#1 (2) { ["foo"]=> string(3) "bar" ["cool"]=> string(4) "attr" }
var_dump($result);
// Prints "bar"
echo $result->foo;
// Prints "attr"
echo $result->cool;
var_dump($weather);
echo "<br>";
echo "<br>";
echo "<br>";
echo "json data";
echo $weather->weather ;
*/
$day = '20130722';
$location = 'Mableton';
$state = 'Ga';
$weather = getPastWeather($location,$state,$day);
foreach($weather->history->dailysummary as $curobj){//->history->observations->dailysummary as $curobj) {
$rainIN = $curobj->precipi;
$rainMM = $curobj->precipm;
}
echo $rainIN;
echo $rainMM;
/*
$jsonIterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator(json_decode($json, TRUE)),
RecursiveIteratorIterator::SELF_FIRST);
foreach ($jsonIterator as $key => $val) {
if(is_array($val)) {
echo "$key:\n";
} else {
echo "$key => $val\n";
}
}
*/
?>