我不知道如何使我的php输出粗体,我已经尝试,但我收到和错误时,我尝试。我试过搜索这个话题,但在我的情况下,没有一个答案对我有帮助。

   while($row = mysql_fetch_array($oPlayerInfo))
{
Print "".$row['FirstName']." ".$row['LastName']."<br>";
Print "Position: ".$row['Position']."<br>";
Print "Height: ".$row['Height']."<br>";
Print "Weight: ".$row['Weight']."<br>";
Print "Birthdate: ".$row['DOB']."<br>";
Print "CNGHL Team: ".$row['CNGHLRights']."<br>";
Print "NHL Team: ".$row['Team']."<br>";
Print "Draft Year: ".$row['CNDraftYR']."<br>";
Print "Draft Position: ".$row['CNDraftPOS']."<br>";
Print "Drafted By: ".$row['CNDraftTEAM']."<br>";
Print "<img src=\"http://www.cnghl.biz/cnghldb/images/".$iPlayerID.".jpg\">";

最佳答案

只需在打印中添加HTML强标记,在不需要的行上删除。

while($row = mysql_fetch_array($oPlayerInfo))
{
  Print "<strong>".$row['FirstName']." ".$row['LastName']."</strong><br>";
  Print "<strong>Position: ".$row['Position']."</strong><br>";
  Print "<strong>Height: ".$row['Height']."</strong><br>";
  Print "<strong>Weight: ".$row['Weight']."</strong><br>";
  Print "<strong>Birthdate: ".$row['DOB']."</strong><br>";
  Print "<strong>CNGHL Team: ".$row['CNGHLRights']."</strong><br>";
  Print "<strong>NHL Team: ".$row['Team']."</strong><br>";
  Print "<strong>Draft Year: ".$row['CNDraftYR']."</strong><br>";
  Print "<strong>Draft Position: ".$row['CNDraftPOS']."</strong><br>";
  Print "<strong>Drafted By: ".$row['CNDraftTEAM']."</strong><br>";
  Print "<img src=\"http://www.cnghl.biz/cnghldb/images/".$iPlayerID.".jpg\">";
}

带着这个
Print "<strong>Height: ".$row['Height']."</strong><br>";

整个路线都会很大胆。下面的那个
Print "<strong>Height:</strong> ".$row['Height']."<br>";

只有标签是粗体的。

08-25 19:47