I am new thanks for the help.
I have a text file set up like this:
word1a<tab>word 2a<tab>word3a<t ab>word4a
word1b<tab>word 2b<tab>word3b<t ab>word4b
word1c<tab>word 2c<tab>word3c<t ab>word4c
I want a php program that compares a date and removes a line if the date is past.
Please don't say to use cron or just throw a function at me, I really am super new =]
The problem I am having already is that I can't seem to assign the values into an array that has them all and remembers them. If I could get it to work, it would look like:
whatever.array would be word1a, word2a, word3a, word4a but it would have all the lines like that....
And then I would work on the date but I can't even get the array to work.
Let me show you what I have, which I basically just copied from a book.
[php]
$values=array(6 ); // 6 different fields in the text file
$arrays=array(1 00); //I have no idea how to really do arrays so I just guessed
$fp = fopen("test.txt ", "r"); //open test.txt to read
$firstline = fgets($fp); //do nothing with the first line for now
print $firstline . "<br /><br />"; //print the first line (debug really)
while (!feof($fp)){ //while not end of file
$i += 1; //increment for array position (again no idea if this is right)
$line = fgets($fp); //read from file
$values = split(" ", $line); //tab-deliminated
$arrays[$i] = $values; //is this right?
print "Show #" . $i . ": <br /> " . $line . "<br />"; //debug print
}//end while
print "<br/><br/><br/>" . "values[0]: " . $values[0] . "values[1]: " . $values[1] . " values[2]: " . $values[2] . " values[3]: " . $values[3] . " values[4]: " . $values[4] . " values[5]: " . $values[5] . " values[6]: " . $values[6] . "<br /><br /><br />" . $arrays; //this is just a test debug print
fclose($fp); //close test.txt
[/php]
The problem is it reads the line into the array, then replaces it with the next line...I think... I am so damn lost help me !! =]