Each chat room provides a chat function to facilitate those chat friends who need to communicate privately. here we will introduce the methods for implementing private chat in my chat room as follows: 1. processing of sent information each private chat should be displayed on the screen of the user and the private chat object, while others do not... each chat room provides a chat function to facilitate those chat friends who need to communicate privately. here we will introduce the methods for implementing private chat in my chat room as follows:
1. processing of sent information
Every private chat is displayed on the screen of the user and the private chat object, and others cannot see it. here, we will process the speech content and save it in the speech file!
// $ Split is the separator
Messagesend. php
+ Indicates the separator // The first one marked as secret indicates private chat, followed by the chat object and its own name, so that the two can see $ message ="
Password $ message ";} else {// if the first flag is open, the object and its name will be followed by $ message ="
$ Message ";}// then save it to the file?>
2. private chat display method
Process and judge each new speech after reading it, and execute messageflush. php in the active refresh program.
This simple method enables private chat.
Note: Before and after saving the file for processing, there are In this way, you don't have to deal with it on the screen!
Article URL:
Reprint ^ at will, but please attach the tutorial address.