Hello,
I currently have far to many images in one directory and would like to seperate them into subfolders. The images are currently named as memberid.extension such as 1234.jpg. Let's assume that I have 10,000 members and 10,000 images.
If 1000 images in the same dir is reasonable then I would like to just create 10 subfolders called 1, 2, 3,....10. Folder 1 would contain all images where the memberid is 1-1000, folder 2 for 1001-2000, etc. It would be easy to just create the folders up to about 50 and have them ready so I wouldn't have to create them dynamically until there are beyond 50k members.
My question is if a member joins with the userid of 12234, how do I determine that it should be placed in the Folder 12? A caveman method would be to do some sort of
if($userid >1000 && $userid < 2001){
$picdir=2;
}
elseif($userid >2000 && $userid < 3001){
$picdir=3;
}
...but it seems a little clumsy. Does anybody have any advice?
Thanks