title: PHP Check if array index is set and not out of bound
body: <p>I am reading from a csv file containing thousands of lines. </p>
  
  <p>Now some lines are not properly formatted and hence when I try to read a particular index in a loop, I get Undefined offset errors. </p>
  
  <p>I want to simply remove those lines. And for that purpose I have to identify which lines are causing problems. </p>
  
  <p>Here is what is happening inside of loop:</p>
  
  <pre><code>$i=0;
  while (!feof($file_handle) ) {
  $line_of_text = fgetcsv($file_handle, 2048,",");
  $idx=$line_of_text[5];
  $i++;
  //do something else
  }
  </code></pre>
  
  <p>The code works perfectly but I get 10-15 errors <code>Undefined offset: 5 in filepath</code> Now it is really difficult to determine those lines by just looking at the file. So is there a way to check if the row contains index 5 element and if not then show row number? I tried isset but it is not working. </p>
  
  <p>Ahmar</p>