PHP code example of siestacat / php-hash-path

1. Go to this page and download the library: Download siestacat/php-hash-path 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/ */

    

siestacat / php-hash-path example snippets


use Siestacat\PhpHashPath\GenHashPath;

$hash = '6520c076303312b8ccfd231632a1f752';

$instance = new GenHashPath(2, 2);
echo $instance->getPathFileSystem($hash); //Output: 65/20/6520c076303312b8ccfd231632a1f752
echo $instance->getPathFileSystem($hash, false); //Output: 65/20

$instance = new GenHashPath(4, 3);
echo $instance->getPathFileSystem($hash); //Output: 6520/c076/3033/6520c076303312b8ccfd231632a1f752
echo $instance->getPathFileSystem($hash, false); //Output: 6520/c076/3033