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 Conditionals

PHP Basic Conditional

It Says Bummer Use the variable to display message

index.php
<?php
$studentOneName = 'Dave';
$studentOneGPA = 3.8;

$studentTwoName = 'Treasure';
$studentTwoGPA = 4.0;

$message1 = ' made the Honor Role';
$message2 = ' has a GPA of ';

//Place your code below this comment
if ($studentOneGPA === 4.0){
   echo $studentOneName . $message1 ;
}else{
   echo $studentOneName . $message2 . $studentOneGPA;
}

if ($studentTwoGPA === 4.0){
   echo $studentTwoName .  $message1;
}else{
   echo $studentTwoName . $message2 . $studentTwoGPA;
}

?>

1 Answer

Use "==" instead of "===" and your code is completely fine. "==" is equal ... it is used for values. "===" is identical it is used to check if an object has the same type as the other...or just to check if 2 objects are identical.

Good Staff man! Much appreciated Tobias.... Have you done the Date Objective Task. The code is alright but I still get the bummer.

No I am not working with PHP so I dont really plan to do an course yet. Altough I know/read/watch enough to know a little bit about it. If you program a while you will get an idea about the code someone is posting, and will find what could be wrong (error handling is and experience which everyone will have to learn). But of course you can post you challange and I take a look at it.