X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/f07477cb289eb839af7255b25188765d5e49ad94..486d4f5ea5be5649cdbc478a9a9948af37e73366:/lib/functions.php?ds=inline diff --git a/lib/functions.php b/lib/functions.php index 2817aa1..df207da 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -25,9 +25,16 @@ */ function s2p($s) { + $block_size = 8; $p = ''; for ($i = 0; $i < strlen($s); $i++) { - $p .= $s{$i} . '/'; + $p .= $s{$i}; + if (($i + 1) % $block_size == 0) { + $p .= '/'; + } + } + if (strlen($s) % $block_size != 0) { + $p .= '/'; } return $p; }