My if statement based on array value being empty refuses to work
<p>I wrote the following script to echo out the contents of a outlook CSV File.</p>

<p>Here is a part of the script which breaks down the CSV into an array that extracts only the following three values, first name, last name and email.</p>

<pre><code>for ($i=87; $i&lt;= $countdel-87; $i=$i+88 ){

if(empty($readout[$i])){ echo "&lt;b style=\"color:RED;\"&gt;FIRST NAME N/A&lt;/b&gt;"; }
else{ echo str_replace("Categories","",$readout[$i]).".........................."; }

if(empty($readout[$i+2])){ echo "&lt;b style=\"color:RED;\"&gt;LAST NAME N/A&lt;/b&gt;".".........................."; }
else{ echo $readout[$i+2].".........................."; };

if(empty($readout[$i+14])){ echo "&lt;b style=\"color:RED;\"&gt;EMAIL N/A&lt;/b&gt;"; }
else{ echo $readout[$i+14]; };

echo "&lt;br&gt;";
}
</code></pre>

<p>The code then spits out a string that looks like this:</p>

<pre><code>Joe ............. Smith ...............jSmith@yahoo.com
</code></pre>

<p>Now say that we do not have the last name or email, instead it will spit out</p>

<pre><code>Joe .......... LAST NAME N/A .............. EMAIL N/A
</code></pre>

<p>This all works just dandy. Where I am having the problem is when I do not have the first name, as it prints out.</p>

<pre><code>........... Smith ..............jSmith@yahoo.com
</code></pre>

<p>This piece of code is where the problem seems to be:</p>

<pre><code>if(empty($readout[$i])){ echo "&lt;b style=\"color:RED;\"&gt;FIRST NAME N/A&lt;/b&gt;"; }
</code></pre>

<p>It appears that the <code>$readout[$i]</code> is never empty although I never see anything print out when there is no value. However all the other <code>$readout[$i+$foo]</code> arrays to work.</p>
