Sami Posted January 6, 2011 Share Posted January 6, 2011 I'd like to create files named 1 - 80.txt, but instead of create 80 files one-by-one, I'd like it to be PHP's duty. but how?(lol, I'm using files instead of database ) Link to comment Share on other sites More sharing options...
boen_robot Posted January 6, 2011 Share Posted January 6, 2011 Create them at once or what?If at once, it's as simple as for($i=1; $i<=80; $i++) {file_put_contents("{$i}.txt", "Content in file {$i}");} Link to comment Share on other sites More sharing options...
Sami Posted January 6, 2011 Author Share Posted January 6, 2011 Thanks:)First I tough it didn't work, but the only problem were that I had forgot to set the permissions of the folder to 777 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.