Home > Backend Development > PHP Tutorial > Chat room technology -- implementation of stickers_PHP tutorial

Chat room technology -- implementation of stickers_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:21:46
Original
1175 people have browsed it

If you can add some beautiful pictures to the chat text...

The generation of image codes is the same as expressions and actions. You can select from the menu or input manually. Only the format
and code are given here. No explanation will be given. Please check the expressions and actions section

1 File format

//$picturefilename

1$split brown suit$splitxw20151.jpg$split
2$split black tuxedo$splitxw201534.jpg$split

Number + name + picture name +

2 Programs

My chat room uses the ///gift+number method to display pictures. Note the three backslashes, which is different from the emoticon
action


//Determine whether the first 7 characters of the speech content are///gift
if(substr($message,0,7) == "/// gift")
{

//Get the number of the picture, 2 characters starting from the 7th character (note that characters are numbered starting from 0)
$id = substr($message,7,2)-1;

//Read the picture file
$giftmsg = file($picturefilename);

//Determine whether the number is legal
if(($id >= 0) && ($id < count($giftmsg)) )
{
//Split the picture row
$gift=split($split,$giftmsg[$id],99);

//Generate the speech content of the picture
$message ="or=$namecolor>$name< /font>Giveo) target=d>$talktoa $gift[1]0 height=60 border=0>";

//Picture generation success sign
$specialsign = 1;
}

}


It’s very simple, isn’t it? Why not try it yourself!!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532410.htmlTechArticleIf you can add some beautiful pictures to the chat text... Generation of picture codes and expressions The actions are the same, you can choose from the menu or input manually. Only the format and code are given here, no more...
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