-2

Can anyone tell me where is the syntax error of the following code:

echo "<td bgcolor=.$cores[i].></td>";       

$cores is an array of colors codes:

$cores = array("#FF0000","#FFBF00","#FFFF00","#04B404","#58FAF4","#0101DF","#8A0886");
TFDD
  • 11
  • 4

1 Answers1

0

try this:

echo "<td bgcolor={$cores[$i]}></td>";  
Miguel Mesquita Alfaiate
  • 2,851
  • 5
  • 30
  • 56