- substr: documentation ( source)
- preg_replace: documentation ( source)
- strtolower: documentation ( source)
<?php
function create_path($hash)
{
return preg_replace('#\S#u', '/$0', strtolower(substr($hash, 0, 5))) .'/';
}
echo 'path: '.create_path('ahqñree');