PHP string equals check fails
<p>I have a weird problem. I have checking a php string like this:</p>

<p>On Page1</p>

<pre><code>$_SESSION['test']=&lt;a value from a row fetched from db&gt;
</code></pre>

<p>On Page2</p>

<pre><code>$myVar=$_SESSION['test'];
echo $myVar;

if($myVar=="This is the match string"){
echo "Matched";
}else{
echo "Not Matched";
}
</code></pre>

<p>I can see that $myVar echoed out the same string that I am checking again "This is the match string" but it still goes into else. I tried:</p>

<pre><code>$myVar=(string)trim($_SESSION['test']);
</code></pre>

<p>but it still goes into else. What can be the issue? Any idea?</p>
