Auto create directories after uploading with PHP
<p>I'm creating a php site where a company will upload a lot of images. I'd like one folder to contain upto 500-1000 files and PHP automatically creates a new one if previous contains more that 1000 files.</p>

<p>For example, <code>px300</code> has folder <code>dir1</code> which stores 500 files, then a new one <code>dir2</code> will be created.</p>

<p>Are there any existed a solutions?</p>
