Home > Backend Development > PHP Tutorial > Chat room based on PHP (2)_PHP tutorial

Chat room based on PHP (2)_PHP tutorial

WBOY
Release: 2016-07-13 17:31:26
Original
743 people have browsed it

Now we finally have everything we need to write a new file:

(as the current mainstream development language)

// Open the file , and truncate the file length to 0
$open_file = fopen("messages.html", "w");

// Write the header information of the file
fputs($open_file, $ header);

// new line
// (use stripSlashes because we don’t want all the escape characters to appear in the message file)
fputs($open_file, stripslashes($new_message ));

// Old lines
fputs($open_file, $old_messages);

// Footer
fputs($open_file, $footer);

//Close the file
fclose($open_file);

?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509075.htmlTechArticleNow we finally have everything we need to write a new file: ?php (as the current mainstream development Language) // Open the file and truncate the file length to 0 open_file = fopen("messages.h...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template