码迷,mamicode.com
首页 > Web开发 > 详细

php实现彩票走势图组选图用颜色区分

时间:2015-05-10 00:49:00      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:

找了好久都没有关于这个的东西,我也是一步一步从百度知道上问出思路来的

$xxx = $row[‘bai‘] ;
$yyy = $row[‘shi‘] ;
$zzz = $row[‘ge‘] ;
$zuxuan = array ("$xxx" , "$yyy" , "$zzz");

if (in_array ("1",$zuxuan)) {
$a=0;
foreach($zuxuan as $value){
if($value=="1")
$a++;
}
if ($a==1) {echo "<td>" . ‘1‘ . "</td>";}
if ($a==2) {echo "<td class = ‘blue‘>" . ‘1‘ . "</td>";}
if ($a==3) {echo "<td class = ‘red‘>" . ‘1‘ . "</td>";}
} else echo "<td>" . ‘&nbsp;‘ . "</td>";

if (in_array ("2",$zuxuan)) {
$a=0;
foreach($zuxuan as $value){
if($value=="2")
$a++;
}
if ($a==1) {echo "<td>" . ‘2‘ . "</td>";}
if ($a==2) {echo "<td class = ‘blue‘>" . ‘2‘ . "</td>";}
if ($a==3) {echo "<td class = ‘red‘>" . ‘2‘ . "</td>";}
} else echo "<td>" . ‘&nbsp;‘ . "</td>";
if (in_array ("3",$zuxuan)) {
$a=0;
foreach($zuxuan as $value){
if($value=="3")
$a++;
}
if ($a==1) {echo "<td>" . ‘3‘ . "</td>";}
if ($a==2) {echo "<td class = ‘blue‘>" . ‘3‘ . "</td>";}
if ($a==3) {echo "<td class = ‘red‘>" . ‘3‘ . "</td>";}
} else echo "<td>" . ‘&nbsp;‘ . "</td>";
if (in_array ("4",$zuxuan)) {
$a=0;
foreach($zuxuan as $value){
if($value=="4")
$a++;
}
if ($a==1) {echo "<td>" . ‘4‘ . "</td>";}
if ($a==2) {echo "<td class = ‘blue‘>" . ‘4‘ . "</td>";}
if ($a==3) {echo "<td class = ‘red‘>" . ‘4‘ . "</td>";}
} else echo "<td>" . ‘&nbsp;‘ . "</td>";
if (in_array ("5",$zuxuan)) {
$a=0;
foreach($zuxuan as $value){
if($value=="5")
$a++;
}
if ($a==1) {echo "<td>" . ‘5‘ . "</td>";}
if ($a==2) {echo "<td class = ‘blue‘>" . ‘5‘ . "</td>";}
if ($a==3) {echo "<td class = ‘red‘>" . ‘5‘ . "</td>";}
} else echo "<td>" . ‘&nbsp;‘ . "</td>";
if (in_array ("6",$zuxuan)) {
$a=0;
foreach($zuxuan as $value){
if($value=="6")
$a++;
}
if ($a==1) {echo "<td>" . ‘6‘ . "</td>";}
if ($a==2) {echo "<td class = ‘blue‘>" . ‘6‘ . "</td>";}
if ($a==3) {echo "<td class = ‘red‘>" . ‘6‘ . "</td>";}
} else echo "<td>" . ‘&nbsp;‘ . "</td>";

我这里是用的1-6,还可以是1-任何,方法比较笨,但能实现相同的结果,如果有高手看到,请帮我改成一个更好的办法实现

php实现彩票走势图组选图用颜色区分

标签:

原文地址:http://www.cnblogs.com/logoner/p/4491444.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!