Home >Backend Development >PHP Tutorial > php 怎么解析通过tcp协议发过来的数据

php 怎么解析通过tcp协议发过来的数据

WBOY
WBOYOriginal
2016-06-13 13:21:481789browse

php 如何解析通过tcp协议发过来的数据
我用tcp调试软件模拟tcp客户端发送数据,php端用socket接受,在cmd下运行,可以正常得到数据并打印到cmd窗口上,但是写到数据库中就成乱码了(英文正常,中文乱码),如果写到本地文件中,不管英文中文都不正常,是怎么回事,还需要再次解析吗?应该和编码没关系,编码utf8和gbk的都试过了

------解决方案--------------------
编码问题

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