PHP PHP Basics Daily Exercise Program True PHP

Assigning results to $isIdentical

I'm struggling with task nr 2. Creating the $isIdentical variable makes sense. Comparing $a to "5" makes sense - $a === "5"

However, I have no idea how to assign the result to $isIdentical.

Could anyone show me what I am missing?

index.php
<?php


$a === "5";
//Place your code below this comment

$isBoolean = true;

$isIdentical = $a;

?>

1 Answer

Adam Ridgley
Adam Ridgley
11,920 Points

You basically need this:

$isIdentical = $a === "5";

However if I needed to do it in a real project I would write it as:

if ($a === "5") {
    $isIdentical = true;
}

I didn't even know you could check the value inline like the challenge wants.