Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
/ Urn Public archive

A PHP library for generating RFC 2141 compliant uniform resource names (URN).

License

Notifications You must be signed in to change notification settings

GravityMedia/Urn

Repository files navigation

Uniform Resource Names (URN)

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads PHP Dependencies

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"

About

A PHP library for generating RFC 2141 compliant uniform resource names (URN).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages