checking array value with if statement always returns (output) false (else)
<p>I've following array:</p>

<pre><code>Array
(
    [0] =&gt;  class="amount"&gt;€39,00
    [2] =&gt;  class="subscription-details"&gt;
    [4] =&gt; für
    [5] =&gt; 1
    [6] =&gt; month
)
</code></pre>

<p>I want to check if the sixth element of the value is "month".</p>

<p>I use this code:</p>

<pre><code>print_r($test[6]); //Output month

if($test[6] == 'month'){
    echo 'Alex'; //should output
}else{
    echo 'Ecke'; //will output
}
</code></pre>

<p>Why this code will output "Ecke" and not "Alex"?</p>

<p>Edit:</p>

<p><code>var_dump($test[6])</code> outputs = string(12)</p>

<p><code>var_export($test[6])</code> outputs = 'month'</p>

<p>var_export($test) =</p>

<pre><code>&lt;pre&gt;array (
  0 =&gt; '&lt;span',
  1 =&gt; 'class="amount"&gt;&amp;euro;39,00&lt;/span&gt;',
  2 =&gt; '&lt;span',
  3 =&gt; 'class="subscription-details"&gt;',
  4 =&gt; 'für',
  5 =&gt; '1',
  6 =&gt; 'month&lt;/span&gt;',
)&lt;/pre&gt;
</code></pre>