- var_dump: documentation ( source)
- array_column: documentation ( source)
- array_merge: documentation ( source)
- array_values: documentation ( source)
- array_filter: documentation ( source)
- in_array: documentation ( source)
<?php
$time_zones = ['America/Indiana/Indianapolis', 'Atlantic/Reykjavik'];
foreach ($time_zones as $tz_name) {
$abbrev = DateTimeZone::listAbbreviations();
$abbrev = array_merge( ...array_values( $abbrev ) );
$abbrev = array_filter( $abbrev, function ( $entry ) use ( $tz_name ) {
return $entry['timezone_id'] === $tz_name;
} );
$does_dst = in_array( true, array_column( $abbrev, 'dst' ), true );
var_dump( $tz_name, $does_dst );
}