1

Topic: How to pack number at line

How to pack number at line consisting of 4 bytes
pack it is necessary to use?

2

Re: How to pack number at line

;
And is more detailed
I need number at line from 4 byte
And it is good that returned an array of bytes
Not literally an array, and a line that it was not necessary then a cycle on this array to do

3

Re: How to pack number at line

bas02;
http://php.net/manual/ru/function.pack.php

4

Re: How to pack number at line

Isokerf;
I
Only there unpuck produces an array that not so

5

Re: How to pack number at line

;
At me the number should be stored in a binary file and should occupy 4 bytes

6

Re: How to pack number at line

;
Wrote such function:
function digtochr ($s) {
//digit to char
for ($i=1; $i <= $this-> pointerLen; $i ++) {
$ss = $s <<8 * ($ i-1);
$ss = chr ($ss>> 8 * ($ this-> pointerLen-1));
$spointer. = $ss;
}
return $spointer;
}
It will be not quickly clear to work how much yet it if it to fulfill repeatedly

7

Re: How to pack number at line

bas02 wrote:

the Isokerf;
I
Only there unpuck produces an array that not so

The received line from four bytes depends, from that what method it received?

8

Re: How to pack number at line

wrote:

it is quite probable that something becomes unnecessary smile

Aha - a DBMS on PHP

9

Re: How to pack number at line

Isokerf;
For process optimization of a choice of the data
Own  it can appear more more optimally than