1. Go to this page and download the library: Download realodix/timezone library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
realodix / timezone example snippets
/**
* @param string $name The name attribute of the select tag
* @param string|null $selected The value of the option to be pre-selected
* @param array|null $attrs Additional HTML attributes
*/
public function toSelectBox(string $name, ?string $selected = null, ?array $attrs = null): string
use Realodix\Timezone\Timezone;
$tz = new Timezone;
$attributes = ['class' => 'form-control', 'id' => 'timezone-select'];
// Generate a select box with the name "timezone", pre-selecting "America/New_York",
// and using the specified attributes.
$tz->toSelectBox('timezone', 'America/New_York', $attributes);
use Realodix\Timezone\Timezone;
$tz = new Timezone;
$tz->toArray();