<?php
$x = [array (
'timestamp' => 1505324820,
'dateTimeISO' => '2017-09-13T13:47:00-04:00',
'tempF' => 71,
'dewpointF' => 63,
'humidity' => 76,
'pressureMB' => 1012,
'altimeterMB' => 1013,
'windMPH' => 10,
'windSpeedMPH' => 10,
'windDirDEG' => 240,
'windGustMPH' => NULL,
'visibilityMI' => 10,
'weather' => 'Cloudy',
'weatherShort' => 'Cloudy',
'weatherCoded' => '::OV',
'weatherPrimary' => 'Cloudy',
'weatherPrimaryCoded' => '::OV',
'cloudsCoded' => 'OV',
'heatindexF' => 71,
'windchillF' => 71,
'feelslikeF' => 71,
'sunriseISO' => '2017-09-13T06:42:20-04:00',
'sunsetISO' => '2017-09-13T19:14:27-04:00',
'snowDepthIN' => NULL,
'precipIN' => 0,
'sky' => 100,
),
array (
'timestamp' => 1505325240,
'dateTimeISO' => '2017-09-13T13:54:00-04:00',
'tempF' => 71,
'dewpointF' => 63,
'humidity' => 76,
'pressureMB' => 1012,
'altimeterMB' => 1013,
'windMPH' => 10,
'windSpeedMPH' => 10,
'windDirDEG' => 250,
'windGustMPH' => NULL,
'visibilityMI' => 10,
'weather' => 'Cloudy',
'weatherShort' => 'Cloudy',
'weatherCoded' => '::OV',
'weatherPrimary' => 'Cloudy',
'weatherPrimaryCoded' => '::OV',
'cloudsCoded' => 'OV',
'heatindexF' => 71,
'windchillF' => 71,
'feelslikeF' => 71,
'sunriseISO' => '2017-09-13T06:42:20-04:00',
'sunsetISO' => '2017-09-13T19:14:27-04:00',
'snowDepthIN' => NULL,
'precipIN' => 0,
'tempMax6hrF' => 75,
'tempMin6hrF' => 57,
'sky' => 100,
),];
$x = array_filter($x, function ($array) {
return array_key_exists('tempMax6hrF', $array);
});
var_dump($x);
- Output for 7.0.0 - 7.0.23, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
- array(1) {
[1]=>
array(28) {
["timestamp"]=>
int(1505325240)
["dateTimeISO"]=>
string(25) "2017-09-13T13:54:00-04:00"
["tempF"]=>
int(71)
["dewpointF"]=>
int(63)
["humidity"]=>
int(76)
["pressureMB"]=>
int(1012)
["altimeterMB"]=>
int(1013)
["windMPH"]=>
int(10)
["windSpeedMPH"]=>
int(10)
["windDirDEG"]=>
int(250)
["windGustMPH"]=>
NULL
["visibilityMI"]=>
int(10)
["weather"]=>
string(6) "Cloudy"
["weatherShort"]=>
string(6) "Cloudy"
["weatherCoded"]=>
string(4) "::OV"
["weatherPrimary"]=>
string(6) "Cloudy"
["weatherPrimaryCoded"]=>
string(4) "::OV"
["cloudsCoded"]=>
string(2) "OV"
["heatindexF"]=>
int(71)
["windchillF"]=>
int(71)
["feelslikeF"]=>
int(71)
["sunriseISO"]=>
string(25) "2017-09-13T06:42:20-04:00"
["sunsetISO"]=>
string(25) "2017-09-13T19:14:27-04:00"
["snowDepthIN"]=>
NULL
["precipIN"]=>
int(0)
["tempMax6hrF"]=>
int(75)
["tempMin6hrF"]=>
int(57)
["sky"]=>
int(100)
}
}
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
array(1) {
[1]=>
array(28) {
["timestamp"]=>
int(1505325240)
["dateTimeISO"]=>
string(25) "2017-09-13T13:54:00-04:00"
["tempF"]=>
int(71)
["dewpointF"]=>
int(63)
["humidity"]=>
int(76)
["pressureMB"]=>
int(1012)
["altimeterMB"]=>
int(1013)
["windMPH"]=>
int(10)
["windSpeedMPH"]=>
int(10)
["windDirDEG"]=>
int(250)
["windGustMPH"]=>
NULL
["visibilityMI"]=>
int(10)
["weather"]=>
string(6) "Cloudy"
["weatherShort"]=>
string(6) "Cloudy"
["weatherCoded"]=>
string(4) "::OV"
["weatherPrimary"]=>
string(6) "Cloudy"
["weatherPrimaryCoded"]=>
string(4) "::OV"
["cloudsCoded"]=>
string(2) "OV"
["heatindexF"]=>
int(71)
["windchillF"]=>
int(71)
["feelslikeF"]=>
int(71)
["sunriseISO"]=>
string(25) "2017-09-13T06:42:20-04:00"
["sunsetISO"]=>
string(25) "2017-09-13T19:14:27-04:00"
["snowDepthIN"]=>
NULL
["precipIN"]=>
int(0)
["tempMax6hrF"]=>
int(75)
["tempMin6hrF"]=>
int(57)
["sky"]=>
int(100)
}
}
preferences:
174.2 ms | 404 KiB | 207 Q