dev-master
9999999-dev https://github.com/jongpak/prob-urlA simple library for handling path of url and matching url easily
MIT
The Requires
- php >=5.4
 
The Development Requires
url path match
                         Wallogit.com
                    
                    2017 © Pedro Peláez
                    
                    
                    
                    
                
                
            
A simple library for handling path of url and matching url easily
A simple library for handling path of url and matching url easily, (*1)
Path class is separating url segments, (*3)
<?php
use Prob\Url\Path;
$path = new Path('/apple/banana');
echo $path->seg(0);             // apple
echo $path->seg(1);             // banana
print_r($path->segments());     // Array ( 'apple', 'banana' )
Matchar class is checking the url matching, (*4)
<?php
use Prob\Url\Matcher;
$pathA = new Matcher('/apple');
print_r($pathA->match('/apple'));         // Array ( )
print_r($pathA->match('/banana'));        // false
$pathB = new Matcher('/apple/banana');
print_r($pathB->match('/apple/banana'));  // Array ( )
print_r($pathB->match('/apple'));         // false
print_r($pathB->match('/banana'));        // false
$pathC = new Matcher('/{board}/{post:int}');
print_r($pathC->match('/free/5'));        // Array ( 'board' => 'free', 'post' => '5' )
print_r($pathC->match('/free'));          // false
print_r($pathC->match('/free/some'));     // false
A simple library for handling path of url and matching url easily
MIT
url path match