Jump to content

Probally a easy question here...


kaze

Recommended Posts

I'm new to this PHP stuff so this is probally hilariously easy for you people:

I have two arrays. A array that has the values of rows and a array that has the values of columns.
I then have a bit of code that generates a table.- I want it so if I have some co-ordinates in my arrays something different would go there then if not.

How would I set it so that this table generator checks every array value in its generation without resorting to half a dozen different loops?

i.e in really quick pseudo code (can't copy and paste due to different systems)
$row[0]=2;
$row[1]=1;
$col[0]=1;
$col[1]=3;

create rows loop (really just counts up with most work being in columns)
create columns loop within that that does

if $currentcolumn[$x]==$col[any of them] && if $currentrow[$x]==$row[any of them] (any of them being the same number for both col and row of course)
{
whatever
}
Link to comment
https://forums.phpfreaks.com/topic/25919-probally-a-easy-question-here/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.