I have started to learn some basic PHP. So far everything worked perfectly until I tried to run some IF/ELSE statements embedded into the markup as you can see in the snipet bellow:
<?php
$msg = 0;
echo $msg;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
</head>
<body>
<?php if ($msg = 5){ ?>
<h1>5</h1>
<?php } elseif ($msg = 0) { ?>
<h1> 0 </h1>
<?php } else { ?>
<h1>Whatever</h1>
<?php } ?>
</body>
</html>
The result is always the first if statement, even if it doesn't meet the condition. In this case the result is:
0
5
Tried everything I knew and searched a lot without any results. What am I doing wrong here?