Hi There! I'm having a slight bit of trouble and I hope someone can help me 🙂
I would like to be able to remove a line from a text file... Here's where I'm at so far:
<?php
//the file
$master = file("master.txt");
//get a random word from the master text file
$word = $master[rand(0, count($master) - 1)];
//add the random word to a different text file
$fp= fopen ("1.txt", 'a');
fwrite ($fp, "$word\n");
fclose ($fp);
/* Here I would like to be able to delete the $word that I've just used from the master.txt */
?>
I hope this is clear enough to understand, because I have a hard time expressing what I would like to do.
Thanks in advance for any help!
Matt