PHP code example of zver / directory-walker

1. Go to this page and download the library: Download zver/directory-walker 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/ */

    

zver / directory-walker example snippets



$path=DirectoryWalker::fromCurrent()
                     ->enter('tests')          //  /project/tests/
                     ->enter('unit/subunit\\') //  /project/tests/unit/subunit/
                     ->up()                    //  /project/tests/unit/
                     ->enter('sub\sub/unit/')  //  /project/tests/unit/sub/sub/unit/
                     ->up(2)                   //  /project/tests/unit/sub/
                     ->upUntil('tests')        //  /project/tests/
                     ->get();