Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics Daily Exercise Program Daily Exercise Program

alan ingram
PLUS
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.

<?php
//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');
var_dump($day);
// 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
PLUS
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.