Home > php教程 > php手册 > PHP的应用聊天室开发完全手册(二)

PHP的应用聊天室开发完全手册(二)

WBOY
Release: 2016-06-13 10:32:50
Original
966 people have browsed it


  现在我们终于有了写新文件所需的所有东西了:
  
  (做为现在的主流开发语言)
  
  // 打开文件,并且将文件长度截为0
  $open_file = fopen("messages.html", "w");
  
  // 写入文件的头信息
  fputs($open_file, $header);
  
  // 新的一行
  // (使用stripSlashes,因为我们不想让所有的转义字符出现在消息文件中)
  fputs($open_file, stripslashes($new_message));
  
  // 旧的行
  fputs($open_file, $old_messages);
  
  // 脚标
  fputs($open_file, $footer);
  
  // 关闭文件
  fclose($open_file);
  
  ?>
  

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template