PHP code example of b4moss / shardian
1. Go to this page and download the library: Download b4moss/shardian 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/ */
b4moss / shardian example snippets
use function B4moss\Shardian\shardian;
use function B4moss\Shardian\shardianSplit;
$path = shardian('abc1234.jpg');
// => '/a/b/c/1/abc1234.jpg'
$path = shardian('abc1234.jpg', ['stripHeadSlash' => true]);
// => 'a/b/c/1/abc1234.jpg'
$split = shardianSplit('abc1234.jpg');
// $split->pathOnly => '/a/b/c/1/'