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

Chat room based on PHP (2)_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:04:48756browse

Now we finally have everything we need to write a new file:
// Open the file and truncate it 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 escape characters appear in the message file)
fputs($open_file, stripslashes($new_message));
// Old lines
fputs($open_file, $old_messages);
/ / Footer
fputs($open_file, $footer);
// Close file
fclose($open_file);
?>
Excerpted from: http://www.9headbird. com/detail.php3?id=8970


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445186.htmlTechArticleNow we finally have everything we need to write a new file: ?php // Open the file and put The file length is truncated to 0 $open_file = fopen(messages.html, w); //Write the header information of the file...
Statement:
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