开发者

PHP: Split string into chunks of 8, how do I do this?

I have binary bas开发者_如何学Pythonically, 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.


str_split:

$chunks = str_split($data, 8);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜