Generating files
Posted: Wed Oct 25, 2006 5:22 am
feyd | Please use
readfrom.txt
and idea is simple. To read from readfrom.txt the names of the files and generate files with the content "plain text here":
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi,
i have the following code, which doesn't have the right output. Is because of !feofCode: Select all
<?php
$file = "readfrom.txt";
$fh = fopen($file, 'r');
while (!feof($fh))
{
$line = fgets($fh, filesize($file));
echo $line;
echo "<br>";
$fd = fopen($line, 'x')or die ("E1");
fwrite($fd, "plain text here") or die ("E2");
fclose($fd);
fclose($fh);
}
?>Code: Select all
name1
name2
name3
name4Code: Select all
name1.txt
name2.txt
name3.txt
name4.txtfeyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]