Home  >  Article  >  Backend Development  >  php数字刷进字符串有关问题

php数字刷进字符串有关问题

WBOY
WBOYOriginal
2016-06-13 12:53:26791browse

php数字刷进字符串问题

本帖最后由 sevencolours24 于 2013-02-26 17:03:54 编辑 我要组织一个字符串,前4个字节放一个UINT,比如65*256+97,后面加一个字符串“@abc”
那么按照字节序显示出来的结果就是"Aa@abc"
比如我定义$a=65*256+97,$b="@abc"
有个变量$c,我要怎么把$a,$b放到$c中才能显示成"Aa@abc"

------解决方案--------------------
用pack()处理$a
或者把$a拆分高低位,各自取chr()的值,然后拼接
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