PHP code example of axy / fs-paths
1. Go to this page and download the library: Download axy/fs-paths library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
axy / fs-paths example snippets
use axy\fs\paths\Paths;
/* Static methods */
Paths::normalize('/one/two/../three'); // "/one/three"
/* Adapters */
$posix = Paths::getAdapter('posix');
$win = Paths::getAdapter('windows');
$posix->isAbsolute('c:\config.sys'); // False
$win->isAbsolute('c:\config.sys'); // True
/* Objects */
$url = Paths::getAdapter('url')->create('http://site.loc/news/view.php?id=10');
$url->resolve('../index.html#footer'); // http://site.loc/index.html#footer
$url->params->fragment; // "footer"