|
Posted by Colin McKinnon on 08/10/06 21:57
Bint wrote:
> How do I use PHP to create a binary array of data? Specifically, I need
> to create an image array ( a string of 16 bit integers that is
> width*height in
> size). I've got a data array coming in as an outside argument which is
> run-length-encoded image data. I can read that image data using ord and
> bit shifting to put my 16 bit values together, but I don't know how to
> plug them
> into a new array (or binary string?). What I am looking for is a binary
> string, I guess, not a php array. Can anyone tell me how to do that?
>
<snip>
I wouldn't bother about trying to find the most efficent storage algorithm.
The best solution is going to depend on whether the resultant data is only
going to be processed by applications you right or if you want to export it
in a form readable by something else. Too minimal a system will probably
end up being ineeficient in terms of the time it takes to process the data.
In the case of the former, a PHP array is probably the easiest. If the
latter - use an image and the GD functions.
(FWIW PHP strings will happily hold binary values)
HTH
C.
Navigation:
[Reply to this message]
|