Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- red
- pink
- purple
- deep purple
- indigo
- blue
- light blue
- cyan
- teal
- green
- <?php
- $file = fopen("files.txt","r");
- while(! feof($file))
- {
- echo fgets($file). "<br />";
- $fileName = fgets($file);
- $myfile = fopen($fileName.'.txt, "w");
- }
- fclose($file);
- ?>
- $handle = fopen("path/to/files.txt", "r");
- $filesToCreate = [];
- if ($handle) {
- while (($line = fgets($handle)) !== false) {
- // you may need to add the full path here..
- $filesToCreate[] = $line . '.txt';
- }
- fclose($handle);
- } else {
- // error opening the file.
- }
- foreach ($filesToCreate as $newFile) {
- $createdFile = fopen($newFile, 'w');
- fclose($createdFile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement