I have a php loop and I have the code that creates a directory...
<?php
for ($i = 0; $i < 925; $i++){
if (!file_exists('C:\wamp\www\maindirectory\mydirectory\0001')) {
mkdir('C:\wamp\www\maindirectory\mydirectory\0001', 0777, true);
}
}
?>
Obviously this code will not work. However, where 0001 is in the above code, I need it to count up as 0001, 0002, 0003, etc. The last directory would be 0925. How can I do this?
";I would guess if you removed that the script might compile and runstr_pad()sprintf()str_repeat( '0', 4 - strlen( $i ) ).$i