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 trialLOUIE MANGARING
1,897 PointsHow to solve challenge task 2 of 2 in PHP basics?
Please help me answer this task as I am having trouble to understand the question. Thank you.
<?php
$a = 5;
$string = '5';
//Place your code below this comment
$booleanOne = true;
var_dump($booleanOne);
$booleanTwo = var_dump($a == $string);
?>
2 Answers
William Li
Courses Plus Student 26,868 PointsCreate a new variable name $booleanTwo. Set $booleanTwo equal to the result of comparing the variable $a as IDENTICAL to the string "5".
For part 2, the challenge wants to you create a new variable named $booleanTwo, it's also a Boolean whose value is assigned by comparing whether $a (defined in line 2) equals to String "5".
<?php
$a = 5;
//Place your code below this comment
$booleanOne = true; // part 1
$booleanTwo = $a == "5"; // part 2
?>
Hope it helps.
Victor Musvibe
10,361 Points$a = 5;
//Place your code below this comment
$booleanOne = true; // part 1
$booleanTwo = ($a === "5"); // part 2
?>
Tibor Katai
2,102 PointsTibor Katai
2,102 PointsUse the === equal sign!