Tianshui online mayor message board with text file making message board tips (bottom)

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.