PHP : If...Else...Query
<p>I am executing this statement under <code>while (($data=fgetcsv($this-&gt;fin,5000,";"))!==FALSE)</code></p>

<p>Now what I want in else loop is to throw exception only for data value which did not satisfy the if condition. Right now am displaying the complete row as I am not sure how to throw exception only for data which does not satisfy the value. </p>

<h2>Code</h2>

<pre><code>if ((strtotime($data[11]) &amp;&amp;strtotime($data[12])&amp;&amp;strtotime($data[16]))!==FALSE 
&amp;&amp; ctype_digit($data[0]) &amp;&amp; ctype_alnum($data[1]) &amp;&amp; ctype_digit($data[2]) 
&amp;&amp; ctype_alnum($data[3]) &amp;&amp; ctype_alnum($data[4]) &amp;&amp; ctype_alnum($data[5]) 
&amp;&amp; ctype_alnum($data[6]) &amp;&amp; ctype_alnum($data[7]) &amp;&amp; ctype_alnum($data[8]) 
&amp;&amp; $this-&gt;_is_valid($data[9]) &amp;&amp; ctype_digit($data[10]) &amp;&amp; ctype_digit($data[13]) 
&amp;&amp; $this-&gt;_is_valid($data[14]))
{
     //Some Logic
}
else
{
    throw new Exception ("Data {$data[0], $data[1], $data[2], $data[3],
    $data[4], $data[5], $data[6], $data[7],
    $data[8], $data[9], $data[10], $data[11], $data[12],
    $data[13], $data[14], $data[16]} is not in valid format");
}
</code></pre>

<p>Guidance would be highly appreciated as to how can I throw exception only for data which did not satisfy the if value. </p>
