Failed to compare empty string
<p>my code :</p>

<pre><code>$disabled = $this-&gt;access-&gt;get_access('disable_header');
$emptyString = '';
var_dump($emptyString);
var_dump($disabled[0]);
if($disabled[0] == '') die('should be here');
if($disabled[0] == ' ') die('should be here');
die('stop');
</code></pre>

<p>and the result is :</p>

<pre><code>string(0) "" string(1) "" stop
</code></pre>

<p>all my condition is failed and i don't know why ..<br />
but if i make $emptyString condition :</p>

<pre><code>if($emptyString == '') die('should be here');
</code></pre>

<p>it give me result :</p>

<pre><code>should be here
</code></pre>

<p>if you see the both $dislabled[0] and $emptyString has the same empty string,
but has different length,
if i make $emptyString length to 1 then:</p>

<pre><code>$disabled = $this-&gt;access-&gt;get_access('disable_header');
$emptyString = ' ';
var_dump($emptyString);
var_dump($disabled[0]);
if($disabled[0] == '') die('should be here');
if($disabled[0] == ' ') die('should be here');
die('stop');
</code></pre>

<p>become :</p>

<pre><code>string(1) " " string(1) "" stop
</code></pre>

<p>i stil failed to compare $disable[0]</p>

<p>what i missed?</p>

<p>====HOW TO RESOLVE===</p>

<p>first i try </p>

<pre><code>mb_detect_encoding($disabled[0]);
</code></pre>

<p>then give me result</p>

<pre><code>ASCII
</code></pre>

<p>then i try :</p>

<pre><code>var_dump(hexdec($disabled[0]))
</code></pre>

<p>then give me result :</p>

<pre><code>int(9)
</code></pre>

<p>i go to ascii table and 9 = TAB key</p>

<p>then now i make condition :</p>

<pre><code>if(strcmp($disabled[0],'')) die('should be here');
</code></pre>

<p>tadaaa .. it show :</p>

<pre><code>should be here
</code></pre>

<p>i think strcmp can work for all enter, tab and space key value ..
any mistake for my opinion?</p>
