List Info

Thread: Listing columns/rows from 2 dimensional array




Listing columns/rows from 2 dimensional array
country flaguser name
United States
2007-06-13 11:43:55
Hi!

I'm using a 2 dimensional array to buffer content that I
display as a
HTML table. Content can be presented as rows:

$mytable[$rowIndex][$columnIndex]

or columns:

$mytable[$columnIndex][$rowIndex].

When operating on rows (insert new row, delete row, change
row
content,...) the first form is more suitable, but when for
example
using array_multisort() someone needs column presentation:
sort array
by the first column, second column,...

My question:
Is there any chance of merging these features into a single
data
structure without doubling data and without falling into
extra foreach/
for loops? I'm aware that memory is addressed linearly...

Thanks for the answer.


--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development
staff at 360 PSG. An enterprise application development
company utilizing open-source technologies for todays
small-to-medium size businesses.

For information or project assistance please visit :
http://www.360psg.com

You received this message because you are subscribed to the
Google Groups "Professional PHP Developers"
group.
To post to this group, send email to Professional-PHPgooglegroups.com
To unsubscribe from this group, send email to
Professional-PHP-unsubscribegooglegroups.com
For more options, visit this group at http:
//groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )