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 trialLindsay Dassau
1,664 PointsI'm having trouble on question 2 of 3 on PHP Basics, Conditionals Challenge
The question is:
Under the variable $name create a if statement that test to see that the $name variable is set to the string 'Mike'.
I've obviously gotten the first question correct. So, so far, I have
<?php $name = "Mike";
if ( ){} ?>
I've tried quite a bit of variations of what I think might be the correct answer, but haven't had much luck.
Thank you in advance!
<?php
$name = "Mike";
if ( ){}
?>
1 Answer
Robert Richey
Courses Plus Student 16,352 PointsHi Lindsay,
Do you remember the operator used when checking for equality? Once you have that, check for equality between the $name
variable and the string 'Mike' as the conditional statement.
Lindsay Dassau
1,664 PointsLindsay Dassau
1,664 PointsThank you Robert, you're a lifesaver! I always seem to make things a little more complicated than they have to be! lol.