Download the PHP package gilbertchiao/taiwan-county-city without Composer

On this page you can find all versions of the php package gilbertchiao/taiwan-county-city. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package taiwan-county-city

台灣縣市資料 PHP 工具 (Taiwan City/County Data for PHP)

此專案提供一個簡單的方式,在 PHP 應用程式中取用台灣的縣市基本資料。資料來源為交通部運輸資料流通服務平臺 (TDX),並已預先處理成方便 PHP 直接使用的格式,無需每次都從資料庫查詢或解析 JSON 檔案。

安裝

您可以使用 Composer 來安裝此套件:

如何使用

根據您的 PHP 版本與偏好,選擇以下其中一種方式使用。

方法一:使用 Cities Class (通用)

這個方法適用於所有 PHP 版本,提供簡單的靜態方法來獲取資料。

範例:

方法二:使用 CityEnum (PHP 8.1+)

如果您使用 PHP 8.1 或更新版本,建議使用 Enum 以獲得更佳的型別安全與可讀性。

範例:

資料來源

所有資料皆來自交通部運輸資料流通服務平臺 (TDX) 的「全臺縣市代碼資料(City) v2」與「全臺縣市代碼資料(County) v2」。

由於此資料不常異動,專案將其轉換為 PHP Class 或 Enum,以便在程式中更有效率地取用。


All versions of taiwan-county-city with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gilbertchiao/taiwan-county-city contains the following files

Loading the files please wait ...