Manage your message in the text file implementation is not as convenient as the database, below we want to achieve this effect!
In the output when we are using an array to save the data, then we will be very convenient for each set of data in order to assign a sequence number, by this sequence number to operate, we can easily modify the data!
$date [0] is the first line in a text file, and we output with an assigned ordinal of 0.
The output has this effect:
Modify Message
We re-customize modify.php
if ($id! = "") {
$date =file ("Txt/mytxt.txt");
$str =explode ("&", $date [0])
?>
}else{
$str = $tech 1. " & ". $tech 2. "&". $tech 3 ....
If ($str! = "") {
Write the modified data back to the text file!
}
}?>
In this process to keep in mind that the value of the $id is not lost, when the data is written back to the text in the value of the first reading into the second, then $date[$id]= $str;
$FP =fopen ("Txt/mytxt.txt", "w");
Fwrite ($fp, $date);
Fclose ($FP);
The above introduces the Tianshui online mayor message board with text files to create message board tips (below), including the Tianshui online mayor message board content, I hope that the PHP tutorial interested in a friend helpful.