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? Link to comment https://forums.phpfreaks.com/topic/20560-creating-1000-folders/ 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. Link to comment https://forums.phpfreaks.com/topic/20560-creating-1000-folders/#findComment-90729 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) Link to comment https://forums.phpfreaks.com/topic/20560-creating-1000-folders/#findComment-90730 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.