Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics Daily Exercise Program Daily Exercise Program

alan ingram
alan ingram
Courses Plus Student 3,979 Points

I straight copied hers and now it wont run after I made one change - changed it back.

//store each exercise in string
$exercise1 = 'Display "Hello World!"';
$exercise2 = 'Convert Pounds to Kilograms';
$exercise3 = 'Convert Kilograms to Pounds';
$exercise4 = 'Convert Miles to Kilometers';
$exercise5 = 'Convert Kilometers to Miles';
$exercise6 = 'Month long string of the day';
$exercise7 = 'String of the day with levels';

// create a variable containing the day of the week
$day = date('N');
// use an if statement to test for the day of the week
if ($day == 1){
  echo $exercise1;
if ($day == 2){
  echo $exercise2;
if ($day == 3){
  echo $exercise3;
if ($day == 4){
  echo $exercise4;
if ($day == 5){
  echo $exercise5;
if ($day == 6){
  echo $exercise6;
if ($day == 7{
  echo $exercise7;
// display the corresponding exercise string


1 Answer

alan ingram
alan ingram
Courses Plus Student 3,979 Points

found it myself. Odd, it would run but not give me the phrase print out, only the date # before. now it gives me both. go figure. The fix shouldnt have allowed the prior to begin with.