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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.