phdevutils / business
Philippine SEC company/partnership registration-number validator and parser — recognizes the CS/CN/A/FS/FN/PG prefix + year + sequence formats and labels the entity type. Zero-dependency. Pairs with phdevutils/psic.
Requires
- php: >=8.1
Requires (Dev)
- phpunit/phpunit: ^10.0
README
Validate and parse Philippine SEC registration numbers in PHP — recognizes the CS / CN / A / FS / FN / PG prefix + year + sequence formats and labels the entity type. Zero-dependency. PHP companion to the npm package @ph-dev-utils/business.
Format-level only. This checks the structure of a registration number and infers the entity type from the prefix. It is not a registry lookup — always confirm a company against the SEC verification portal.
composer require phdevutils/business
Quick start
use PhDevUtils\Business\Sec; Sec::validate('CS2019-12345'); // true Sec::validate('cs201912345'); // true (dashes/spaces/case ignored) Sec::validate('12345678'); // false (purely numeric legacy certs are out of scope) Sec::parse('CS2019-12345'); // [ // 'prefix' => 'CS', 'entityType' => 'corporation', // 'entityLabel' => 'Stock or non-stock corporation (unified)', 'era' => '2013–present', // 'year' => 2019, 'sequence' => '12345', 'formatted' => 'CS2019-12345', 'raw' => 'CS2019-12345' // ] Sec::entityType('PG2018-00042'); // 'partnership' Sec::format('cs 2019 12345'); // 'CS2019-12345' (canonical form)
API
| Method | Returns |
|---|---|
Sec::validate($input) |
bool — matches a recognized SEC reg-number structure |
Sec::parse($input) |
array | null — prefix, entity type, year, sequence, canonical form |
Sec::entityType($input) |
string | null |
Sec::format($input) |
string | null — canonical PREFIX + YEAR-SEQUENCE |
Sec::prefixes() |
the documented prefix table (prefix, entityType, label, era) |
Recognized prefixes
| Prefix | Entity type | Era |
|---|---|---|
CS |
Stock or non-stock corporation (unified) | 2013–present |
CN |
Non-stock corporation (legacy) | 1986–2012 |
A |
Stock corporation (legacy) | pre-2000 |
FS |
Foreign stock corporation / branch | 2000–present |
FN |
Foreign non-stock corporation | 2000–present |
PG |
Partnership | 2017–present |
The recognized structure is prefix + 4-digit year (19xx/20xx) + 3–8 digit sequence, e.g. CS2019-12345. Entity-type labels are a best-effort reading of public SEC guidance — prefixes and their meanings have shifted across eras, so treat them as indicative.
Industry classification
To tag a company's industry, pair this with phdevutils/psic (Philippine Standard Industrial Classification — sections + divisions).
License
MIT. SEC registration-number formats are factual public information; not affiliated with the Philippine SEC.