Simple PHP IF/ELSE code not working properly with html markup : <p>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:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php 
$msg = 0;
echo $msg;
?&gt;

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;title&gt;Test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php if ($msg = 5){ ?&gt;
        &lt;h1&gt;5&lt;/h1&gt;
    &lt;?php } elseif ($msg = 0) { ?&gt;
        &lt;h1&gt; 0 &lt;/h1&gt;
    &lt;?php } else { ?&gt;
        &lt;h1&gt;Whatever&lt;/h1&gt;
    &lt;?php } ?&gt;
&lt;/body&gt;
&lt;/html&gt; </code></pre>
</div>
</div>
</p>

<p>The result is always the first if statement, even if it doesn't meet the condition. In this case the result is:</p>

<p>0</p>

<p><strong>5</strong></p>

<p>Tried everything I knew and searched a lot without any results. What am I doing wrong here?</p>
