Jump to content

creating files named 1 - 80


Sami

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...