jmsfwk/surlf

A library for formatting urls in the style of printf strings.

Maintainers

Package info

github.com/jmsfwk/surlf

pkg:composer/jmsfwk/surlf

Statistics

Installs: 108

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

v1.0.2 2019-04-12 10:08 UTC

This package is auto-updated.

Last update: 2026-03-01 00:26:14 UTC


README

Build Status

Usage

use Jmsfwk\Surlf\Formatter;

echo Formatter::format('%h/%p', 'http://example.com/a-path');
// example.com/a-path

Formats

The examples in the table below are based on the url http://example.com/a/b/c?d=e&f=g.

Format character Description Example
s URL scheme http
h Host example.com
p Path a/b/c
q Query d=e&f=g
% Literal % character %