开发者

New byte in php

开发者 https://www.devze.com 2022-12-26 05:50 出处:网络
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

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

精彩评论

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