PHPackages                             maximgrynykha/path2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. maximgrynykha/path2

ActiveLibrary[File &amp; Storage](/categories/file-storage)

maximgrynykha/path2
===================

Normalize paths to files &amp; directories in PHP

v1.1.0(4y ago)16[1 issues](https://github.com/MaximGrynykha/path2/issues)MITPHPPHP ^8.1CI failing

Since Jan 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/MaximGrynykha/path2)[ Packagist](https://packagist.org/packages/maximgrynykha/path2)[ Docs](https://github.com/MaximGrynykha/path2)[ RSS](/packages/maximgrynykha-path2/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/c9bfb68f59cd79c0a6ae61b364bb4117bfc3c25193368fa760e68503f22ac364/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f4d6178696d4772796e796b68612f70617468322f4275696c643f6c6162656c3d6275696c64266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465267374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/c9bfb68f59cd79c0a6ae61b364bb4117bfc3c25193368fa760e68503f22ac364/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f4d6178696d4772796e796b68612f70617468322f4275696c643f6c6162656c3d6275696c64266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465267374796c653d666f722d7468652d6261646765)

**Path2**
=========

[](#path2)

If you are not confident that your program will properly lead the way to the required file or directory - use Path2, it automatically converts all slashes to those which are used in the current operating system, yet so over also will trim excess slashes if there are in the path.

⚙️ Installation
---------------

[](#️-installation)

To install this library - run the command below in your terminal:

```
composer require maximgrynykha/path2
```

Usage
-----

[](#usage)

```
