Skip to content

Instantly share code, notes, and snippets.

@dunglas
Created May 25, 2020 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dunglas/5b10b586427cf66e78a968f82f80691a to your computer and use it in GitHub Desktop.
Save dunglas/5b10b586427cf66e78a968f82f80691a to your computer and use it in GitHub Desktop.
URI Template test in PHP
<?php
require __DIR__.'/vendor/autoload.php';
use Rize\UriTemplate;
$uri = new UriTemplate('', ['version' => 1.1]);
var_dump($uri->extract('https://example.net/{ip}', 'https://example.net/2001:db8::35'));
var_dump($uri->extract('https://example.net/{ip}', 'https://example.net/2001:db8::35', true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment