开发者

New byte in php

I have code JAVA

byte abyte1[] = new byte[k]开发者_如何转开发;

But php not have byte type. Its possible to convert this line to php?


The concept of a fixed-length array is not really one that exists in php. Additonally, you don't specify the type of an array either, instead all arrays are actually a hash, that can store any type.

The closest thing to what you ask is:

$abyte1 = array();

And then you can just insert bytes as you might normally:

$abyte1[0] = 1;
$abyte1[1] = 2;

Or you can add to the end of the list:

$abyte1[] = 3;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜