Download the PHP package phdevutils/core without Composer

On this page you can find all versions of the php package phdevutils/core. 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 core

phdevutils/core

Packagist version License: MIT Made in PH

Filipino developer utilities for PHP — peso formatting, government ID validators (TIN / SSS / PhilHealth / Pag-IBIG), PH phone parsing with network detection, and PSGC region / province lookup.

Need fake test data on top of this? See the sibling phdevutils/faker.

Install

Requires PHP 8.1+.

Quick start

API Reference

PhDevUtils\Peso

Peso::format(float $value, array $opts = []): string

Format a number as a peso amount with thousands separators.

Options array shape: ['decimals' => int, 'symbol' => 'peso'|'php'|'none']. Defaults: decimals: 2, symbol: 'peso'.

Peso::parse(string $input): ?float

Parse a peso-formatted string back to a float. Strips , PHP, whitespace, and commas. Returns null for unparseable input.

Peso::toWords(float $value): string

Convert to English peso-and-centavos word form. Singular/plural handled.

Peso::toWordsFilipino(float $value): string (v0.3)

Convert to Filipino (Tagalog) peso-and-centavos word form, using the check/receipt convention [whole-words] at [XX]/100 piso. Handles ligature rules and the daan/raan initial-consonant alternation.

Range: sero (0) through trilyon (10^12).


Government ID validators (PhDevUtils\Validators\*)

⚠️ All validators are format-level only. SSS / PhilHealth / Pag-IBIG do not publish official checksum algorithms; unofficial implementations produce confident-but-wrong results in production. This package returns true for any input with the correct digit count.

Validators\Tin::validate(string $input): bool / Validators\Tin::format(string $input): ?string

BIR TIN: 9 digits (individual) or 12 digits (with branch).

Validators\Sss::validate(string $input): bool / Validators\Sss::format(string $input): ?string

SSS: exactly 10 digits, formatted XX-XXXXXXX-X.

Validators\PhilHealth::validate(string $input): bool / Validators\PhilHealth::format(string $input): ?string

PhilHealth PIN: 12 digits, formatted XX-XXXXXXXXX-X.

Validators\PagIbig::validate(string $input): bool / Validators\PagIbig::format(string $input): ?string

Pag-IBIG MID: 12 digits, formatted XXXX-XXXX-XXXX.


PhDevUtils\Phone

Phone::parseMobile(string $input): ?array

Parse a PH mobile number with network detection. Accepts +63..., 63..., 09..., and 9... forms. Returns null if it doesn't normalize to an 11-digit PH mobile.

Return shape:

Phone::parseLandline(string $input): ?array

Parse a PH landline with area code lookup.


PhDevUtils\Address

Region and province data follows the Philippine Standard Geographic Code at v0.1 granularity (regions + provinces). Cities, municipalities, and barangays are on the v0.2 roadmap.

Address::listRegions(): array

Returns all 17 PH regions. Each element shape: ['code' => string, 'name' => string, 'designation' => string].

Address::findRegion(string $query): ?array

Look up by code, name, or designation (case-insensitive). Returns null if not found.

Address::listProvinces(?string $regionCode = null): array

Returns all provinces, optionally filtered by region code. Each element shape: ['code' => string, 'name' => string, 'region' => string].

Address::findProvince(string $query): ?array

Look up by code or name (case-insensitive).


Modules table

Direct mapping to the JavaScript sibling package:

Capability PHP JS
Format peso Peso::format($n) formatPHP(n)
Parse peso Peso::parse($s) parsePHP(s)
Peso to words (English) Peso::toWords($n) pesoToWords(n)
Peso to words (Filipino) Peso::toWordsFilipino($n) pesoToWordsFilipino(n)
Validate TIN Validators\Tin::validate($s) validateTIN(s)
Validate SSS Validators\Sss::validate($s) validateSSS(s)
Validate PhilHealth Validators\PhilHealth::validate($s) validatePhilHealth(s)
Validate Pag-IBIG Validators\PagIbig::validate($s) validatePagIBIG(s)
Parse mobile Phone::parseMobile($s) parseMobile(s)
Parse landline Phone::parseLandline($s) parseLandline(s)
List regions Address::listRegions() listRegions()
Find region Address::findRegion($q) findRegion(q)
List provinces Address::listProvinces($code = null) listProvinces(code?)
Find province Address::findProvince($q) findProvince(q)

License

MIT


All versions of core with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 phdevutils/core contains the following files

Loading the files please wait ...