|
Posted by Lars Eighner on 10/17/07 19:52
In our last episode, <13hco71gbsmmb66@corp.supernews.com>, the lovely and
talented Bint broadcast on comp.lang.php:
> I have an array whose elements I'm accessing, like array[0], array[1],
> etc. However, the data is meant to be 16-bit words, not bytes. I'm
> getting byte values right now. Is there any way I can tell php that an
> array is composed of words and not bytes?
Your question appears to be nonsense. In PHP, arrays are a compound type.
The keys must be integers or strings (yours appear to be integers so far).
Values may be any PHP type including array. The maximum size of the types
are, in general, platform dependant, but I do not know of a platform on
which PHP will compile in which you would be limited to 8 bits. If you are
getting byte values out of an array it is because someone, possibly you, put
byte values into the array. If you want 16-bit values in an array, put
16-bit values in it.
PHP is a high-level language. Ordinarily you should not know or care what
the low-level memory arrangements are. If you are trying to do something
special, you'll have to tell us what it is.
--
Lars Eighner <http://larseighner.com/> <http://myspace.com/larseighner>
Countdown: 460 days to go.
What do you do when you're debranded?
Navigation:
[Reply to this message]
|