我想确定相同的团队名称(与变量$home_team['team_name']
和一起输出$away_team['team_name']
)是否在
if ($game_date_converted == $next_monday)
陈述。
如果团队名称确实出现了不止一次(例如,如果它出现两次),我希望该文本以红色显示。
简而言之,对于比赛列表,如果球队名称(可能是主队或客队)出现两次,则以 RED 显示该球队名称。
感谢您的帮助!
<?php foreach ($games as $game) { ?>
<?php
$team_id = $game['home_team_id'];
$home_team = sw::shared()->teams->getForID($team_id);
$away_team_id = $game['away_team_id'];
$away_team = sw::shared()->teams->getForID($away_team_id);
$leagues = sw::shared()->packages->getAll();
$game_date = $game['date'];
$game_date_converted = date('Y-m-d', strtotime($game_date));
$date_converted = date('l', strtotime($game_date));
?>
<?php if ($game_date_converted == $next_monday) { ?>
<tr>
<td><?php echo $home_team['team_name']; ?></td>
<td><?php echo $away_team['team_name']; ?></td>
<!-- more HTML -->