Jump to content

Trying IF THEN ELSE but not working.... suggestions?


cowboysdude

Recommended Posts

This is what I am using and it returns the entire schedule for the whole league...

 

if ($display == "schedule") {

$schedule = $ffn->getSchedule();

echo '<h4>Season Schedule</h4>';
echo '<p>Season: ', $schedule->Season, '</p>';

foreach($schedule->Games AS $game) {
echo '<p>';
echo 'Week: ', $game->Week, ' ', $game->AwayTeam, ' at ', $game->HomeTeam, ' on ', date("M j, Y", strtotime($game->GameDate)), ' at ', $game->GameTime, ' ', $schedule->Timezone;
echo '</p>';
}
}

 

BUT what I would like to do is search the info and only post info for one team...

 

I have tried this...

 

if ($display == "schedule") {

$schedule = $ffn->getSchedule();

echo '<h4>Season Schedule</h4>';
echo '<p>Season: ', $schedule->Season, '</p>';

foreach($schedule->Games AS $game)
if (AwayTeam == 'DAL") {
echo '<p>';
echo 'Week: ', $game->Week, ' ', $game->AwayTeam, ' at ', $game->HomeTeam, ' on ', date("M j, Y", strtotime($game->GameDate)), ' at ', $game->GameTime, ' ', $schedule->Timezone;
echo '</p>';
}
}
ELSE IF (HomeTeam == 'DAL')
if ($display == "schedule") {

$schedule = $ffn->getSchedule();

echo '<h4>Season Schedule</h4>';
echo '<p>Season: ', $schedule->Season, '</p>';

foreach($schedule->Games AS $game) {
echo '<p>';
echo 'Week: ', $game->Week, ' ', $game->AwayTeam, ' at ', $game->HomeTeam, ' on ', date("M j, Y", strtotime($game->GameDate)), ' at ', $game->GameTime, ' ', $schedule->Timezone;
echo '</p>';
}
}

Else 
echo "No Games Scheduled"

 

Problem is it's not working... how can I just pull the info for DAL and only display that info.  The info is coming from an XML file...

 

Thanks in Advance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.