public static function getPathById table id str path countZero 10 strl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
public static function getPathById($table, $id)
{
$str = '';
$path = '';
$countZero = 10 - strlen($id);
for ($i = 0; $i < $countZero; $i++) {
$str .= '0';
}
$array = str_split($str . $id, 2);
foreach ($array as $val) {
$path .= $val . '/';
}
return $table . '/' . $path;
}