blob: cc04b5aa73d620cfaac1578aa16179322d37bb63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
Path
====
[![Build Status](https://travis-ci.org/JosephMoniz/php-path.png?branch=master)](undefined)
Simple and care free file path concatenation and simplification.
```php
<?php
use PlasmaConduit\Path;
Path::join("wat", "lol"); // -> wat/lol
Path::join("/a", "///b"); // -> /a/b
Path::join("/a", "b", "c", "..", "d"); // -> /a/b/d
Path::normalize("/a/b/c/../d"); // -> /a/b/d
Path::normalize("/a/b/c/../../d"); // -> /a/d
Path::normalize("/b/wat//"); // -> /b/wat/
Path::normalize("/b///wat/"); // -> /b/wat/
Path::normalize(""); // -> .
Path::normalize("/"); // -> /
```
|