Forum : code error
Brief description  about Online courses   join in Online courses
View nishant  gaurav 's Profile

code error

<html>
<body>
<?php
$colour = array("1st" => "red","2nd" => "blue","3rd" => "black");
echo"<table>";
echo"<tr>";
echo'<td bgcolor="red">echo $colour["1st"]</td>';
echo'<td bgcolor="blue">echo $colour["2nd"]</td>';
echo'<td bgcolor="black">echo $colour["3rd"]</td>';
echo"</tr>";
echo"</table>";
?>
</body>
</html>
is the code is correct,if no ,please tell me the correct one.
Asked by nishant gaurav | Oct 2, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Nishant,
use the fallowing code

<html>
<body>
<?php
$colour = array("1st" => "red","2nd" => "blue","3rd" => "black");
echo"<table>";
echo"<tr>";
echo'<td bgcolor="red">'.$colour["1st"].'</td>';
echo'<td bgcolor="blue">'.$colour["2nd"].'</td>';
echo'<td bgcolor="black">'.$colour["3rd"].'</td>';
echo"</tr>";
echo"</table>";
?>
</body>
</html>
Oct 6, 2010