You are here: Re: arrays -- can they be words, not bytes? « PHP Programming Language « IT news, forums, messages
Re: arrays -- can they be words, not bytes?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация