gravitymedia / urn
A PHP library for generating RFC 2141 compliant uniform resource names (URN).
Installs: 6 666
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^5.4
- scrutinizer/ocular: ^1.3
This package is auto-updated.
Last update: 2023-02-27 00:40:26 UTC
README
A PHP library for generating RFC 2141 compliant uniform resource names (URN).
Requirements
This library has the following requirements:
- PHP 5.6+
Installation
Install Composer in your project:
$ curl -s https://getcomposer.org/installer | php
Require the package via Composer:
$ php composer.phar require gravitymedia/urn
Usage
// require autoloader require 'vendor/autoload.php'; // import classes use GravityMedia\Urn\Urn; // create URN object from string $urn = Urn::fromString('urn:example-namespace-id:just_an_example'); // dump namespace identifier var_dump($urn->getNamespaceIdentifier()); // string(20) "example-namespace-id" // dump namespace specific string var_dump($urn->getNamespaceSpecificString()); // string(15) "just_an_example"