title: If condition always returning true
body: <p>I am reading a text file line by line and each line has comma separated values. example</p>
  
  <pre><code>Name,Phone,URL,notavailable
  </code></pre>
  
  <p>The reading is fine and the script returns the lines correctly. The last value has "available" or "notavailable".</p>
  
  <p>I am exploding a line like this</p>
  
  <pre><code>$sections = explode(",", $line);
  </code></pre>
  
  <p>and it returns</p>
  
  <pre><code>    Array
      (
          [0] =&gt; Name
          [1] =&gt; Phone
          [2] =&gt; URL
          [3] =&gt; notavailable
  
      )
  </code></pre>
  
  <p>I can get values using </p>
  
  <pre><code>$sections[0], $sections[1] etc.
  </code></pre>
  
  <p>And they display just fine. But the problem occurs when I try to compare the last value. </p>
  
  <pre><code>$check = $sections[3];
  if($check=="notavailable")
  {Do something }
  else {Do something else}
  </code></pre>
  
  <p>But the if statement always returns false. I could not figure that out. Tried so many time. It will be so much helpful somebody can point out the error in my script.</p>
  
  <p>Thanks in advance. </p>