Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define array of bytes in PHP

Tags:

php

I need help with PHP, I need to define byte array and to change values of some bytes ( for example set 3rd byte to 16 or 17 and so on ). How to define array of bytes in PHP ?

like image 218
Damir Avatar asked Oct 24 '25 05:10

Damir


1 Answers

I am not entirely sure what you mean when you say byte. But try this:

<?php
$bytes = array(1, 50, 39, 21, 93, 20);
$bytes[2] = 16; // Changes 3rd byte to 16
like image 147
eisberg Avatar answered Oct 25 '25 19:10

eisberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!