Skip to content

Instantly share code, notes, and snippets.

@dnikonov
Last active December 17, 2015 09:39
Show Gist options
  • Save dnikonov/5589053 to your computer and use it in GitHub Desktop.
Save dnikonov/5589053 to your computer and use it in GitHub Desktop.
PHP: getDir
/**
* берет путь до файла (вложенность директорий)
* @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