help-how to control four relays with two different ON and OFF timings.

#define ledpin1 6
#define ledpin2 7
#define ledpin3 8
#define ledpin4 9

//how to store the state of the relays???

int ledpin1_state=LOW;
int ledpin2_state=LOW;
int ledpin3_state=LOW;
int ledpin4_state=LOW;

long previousmillis=0;
unsigned long array1[4][4]={{1000,2000,4000,5000},{2000,4000,5000,6000},{1000,3000,5000,6000},{500,1000,2500,4700}};
long unsigned interval= 500;

void setup()
{
pinMode(ledpin1,OUTPUT);
pinMode(ledpin2,OUTPUT);
pinMode(ledpin3,OUTPUT);
pinMode(ledpin4,OUTPUT);
Serial.begin(9600);
}

void loop()
{
unsigned long currentmillis=millis();
while((currentmillis-previousmillis)<=interval)
{
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{

currentmillis=millis();
if(j%2==0)
{
Serial.println(“high”);
Serial.println(currentmillis);
//Serial.println(i,j);
ledpin1==HIGH;
ledpin2==HIGH;
ledpin3==HIGH;
ledpin4==HIGH;
}
else
{
Serial.println(“LOW”);
Serial.println(currentmillis);
//Serial.println(i,j);
ledpin1==LOW;
ledpin2==LOW;
ledpin3==LOW;
ledpin4==LOW;
}
previousmillis=currentmillis;
}
}
}
}

Please put code tags around your code. It is formatting symbol </>. You could also hit Ctrl-T in arduino IDE for better formatting.

Code tag will make your code look like this

  ledpin4==LOW;

Btw, it should be single = in all those lines. Double == is for comparision, single = for assigning a value.