PHP:将字符串分成 8 个块,我该怎么做?
我基本上有二进制,假设它的长度是300。我如何将它拆分(就像使用爆炸一样)成 8 位块?我查看了 chunk_split() 但它似乎只有一个“end”参数,而不是将其放入数组的选项。或者它可以插入数组吗?
末尾 8 位数字可以低于 8(如果有人抄错,则为 4),因此不需要验证,只需从开始到结束始终保持 8 个数字块即可。
I have binary basically, say it's 300 in length. How would I split (much like using explode) it into 8 bit chunks? I look at chunk_split() but it only seems to have an 'end' parameter, not an option to put it into an array.. Or can it be socketed into an array?
The end 8 digits can be below 8 (in case a miscopy from someone, and it's 4) so no validation is needed, just consistantly in 8 number chunks from the start to end.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
str_split
:str_split
: