RE: php date function

Author: Virgil Bierschwale

Posted: 2013-09-24 at 13:18:19

Here is some code I use for changing video's each day

Should be self explanatory, but if not, give me a shout

<?php

//Give what day of the week it is. Returns Sunday through Saturday.

$day = date("l");

if ($day == "Monday")

{

// Clint Eastwood

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"

allowfullscreen></iframe>';

// Gomer Pyle

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

}

elseif ($day == "Tuesday")

{

// College Girl

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/j6iqTHJHW5o?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

// Clint Eastwood

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"

allowfullscreen></iframe>';

}

elseif ($day == "Wednesday")

{

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"

allowfullscreen></iframe>';

}

elseif ($day == "Thursday")

{

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"

allowfullscreen></iframe>';

}

elseif ($day == "Friday")

{

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"

allowfullscreen></iframe>';

}

elseif ($day == "Saturday")

{

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"

allowfullscreen></iframe>';

}

elseif ($day == "Sunday")

{

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

echo '<iframe width="510" height="315"

src="http://www.youtube.com/embed/1sJl5OC7LCU?feature=player_embedded"

frameborder="0" allowfullscreen></iframe>';

}

?>

-----Original Message-----

From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink

Sent: Tuesday, September 24, 2013 1:09 PM

To: 'ProFox Email List'

Subject: php date function

Could somebody get me started on a PHP switch or IF ELSE function to set the

current week of a football season. Right now I am setting the date manually

each week with the following:

<?php

// function TO GET curweek of football season

function getCurWeek() {

$curWeek = '05';

return $curWeek;

} // end of getCurWeek

?>

Ideally I want to test the current date if it's between the start and end

date of each week. The wrinkle is and I need to adjust somehow, the pro

season is 1-week behind the college season and anything past curweek['15']

will be 'PS' post season for college and past curweek['17'] for pro's will

be 'PS' if you follow. I'll probably have to return two values instead of

the 1 that I'm doing now. I tried several and my php date syntax doesn't

work.

Gary Jeurink

--- StripMime Report -- processed MIME parts --- multipart/alternative

text/plain (text body -- kept)

text/html

---

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/096201ceb952$736cf3a0$5a46dae0$@gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2013 Virgil Bierschwale