timezone_location_get()
timezone_location_get() — Alias of DateTimeZone::getLocation().
Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.3.0, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
timezone_location_get() is an alias of DateTimeZone::getLocation(): same parameters, same return value.
Signature
timezone_location_get(DateTimeZone $object): array|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $object | DateTimeZone | Procedural style only: A DateTimeZone object returned by timezone_open() |
Return value
Array containing location information about timezone or false on failure.
Example
A runnable snippet:
$tz = new DateTimeZone("Asia/Jakarta"); print_r($tz->getLocation()); print_r(timezone_location_get($tz));
Output:
Array ( [country_code] => ID [latitude] => -6.16667 [longitude] => 106.8 [comments] => Java, Sumatra ) Array ( [country_code] => ID [latitude] => -6.16667 [longitude] => 106.8 [comments] => Java, Sumatra )
All PHP 8.5 built-in functions
Reference card built from the PHP manual page timezone_location_get() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.