Last active
December 17, 2015 09:39
-
-
Save dnikonov/5589053 to your computer and use it in GitHub Desktop.
PHP: getDir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* берет путь до файла (вложенность директорий) | |
* @param integer $id идентификатор файла | |
* @return string путь до файла | |
*/ | |
function getDir($id) | |
{ | |
return floor($id / 10000).DS.floor($id % 10000 / 100).DS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment