Home  >  Article  >  Backend Development  >  php 表格問題,该怎么解决

php 表格問題,该怎么解决

WBOY
WBOYOriginal
2016-06-13 10:16:47968browse

php 表格問題
請問一下各位先進,下有一個PHP頁面,是輸出表格的~ 如果......需要輸出一個表格,能讓每行分數最大的數字顯示為紅色. 請問要如何做呢?? 謝謝各位了>

----------------------------------------------




照片評分詳細表


照片評分詳細表


echo "

";
echo"";
  require("use_mysql.php");
$query = "SELECT p1,p2,p3,p4,p5 FROM text ORDER BY no DESC LIMIT 0,10";
$result = use_mysql($query);
while($row = mysql_fetch_array($result)){ 
?>
$e = $row['p1'];
$f = $row['p2'];
$g = $row['p3'];
$h = $row['p4'];
$i = $row['p5'];


  echo "";
  echo "";
  echo "";
  echo "";
  echo "";
  echo "";
  echo "";
?>

}

?>


讓變數$e $f $g $ h $i去做數字大小比較,並讓每行數字最大者顯示為紅色字>
------解决方案--------------------
循环中
$k = array_search(max($row), $row);
$row[$k] = "{$row[$k]}";

echo '';
foreach($row as $v) echo "";
echo '';
No.1分數 No.2分數 No.3分數 No.4分數 No.5分數
'{$e}''{$f}''{$g}''{$h}''{$i}'
'$v'
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn