CircularStopSign Posted September 12, 2006 Share Posted September 12, 2006 i need to create 1000 folders, 1-1000 but i dont feel like creating it all by hand, is there any loop code that i could use to do this for my web server? Quote Link to comment Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 you could just do...[code]for ($i=1;$i <= 1000;$i++) { mkdir("folder_$i");}[/code]Of course that's just something simple. Probably want to make sure the directory you're writing to has read/write perms. Just look up mkdir() function in the manual and that should get you on the right path. Oh yeah, it'll probably time out so you'll probably want to set your max_execution_time() in your php.ini file to something higher than 30 seconds. Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted September 12, 2006 Share Posted September 12, 2006 Use the PHP mkdir command, see [url=http://nl3.php.net/manual/en/function.mkdir.php]http://nl3.php.net/manual/en/function.mkdir.php[/url][quote]bool mkdir ( string pathname [, int mode [, bool recursive [, resource context]]] )Attempts to create the directory specified by pathname.[/quote]Ronald 8) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.