If I have a file called file.html how do i make 10 clones of this file via PHP such that they are renamed file1….file10?
This code makes the files but they are all blank when they should be duplicates of mypage.html (which is less than 1kb)
<?php
$text = file_get_contents('mypage.html');
for($i = 0; $i < 100; $i++) {
file_put_contents('file'.$i.'.html', $data);
}
?>
If I have a file called file.html how do i make 10 clones of this file via PHP such that they are renamed file1….file10?
This code makes the files but they are all blank when they should be duplicates of mypage.html (which is less than 1kb)
Look at your variable names: