title: PHP foreach with null value
body: <p>I have currently a problem with a foreach loop. I have a table with string value or null value and when I use a foreach to display it, there is no line break but with a for loop, it displays it correctly.
  My foreach code:</p>
  
  <pre><code>foreach($table_iban_out as $element){
      echo $element.'&lt;br/&gt;';
  }
  </code></pre>
  
  <p>And my for code:</p>
  
  <pre><code>for($i=0; $i&lt;count($table_iban_out);$i++){
      echo $table_iban_out[$i].'&lt;br/&gt;';
  }
  </code></pre>
  
  <p>For my table, [0] and <a href="https://i.stack.imgur.com/Xhx8r.png" rel="nofollow noreferrer">1</a> are null, [2]-[6] are strings and [7] is null again so I should have something like that on my page:</p>
  
  <ul>
  <li>void</li>
  <li>void</li>
  <li>string</li>
  <li>...</li>
  <li>void again</li>
  </ul>
  
  <p>I tried with a simple array</p>
  
  <pre><code>$table = array('a','','b');
  </code></pre>
  
  <p>and it works with a foreach loop, so anyone knows with it doesn't work with my $table_iban_out table?</p>
  
  <p>Thanks</p>
  
  <p>edit: Thanks for your help, this is what I get when I use</p>
  
  <pre><code>var_dump($table_iban_out);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Xhx8r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xhx8r.png" alt="enter image description here"></a></p>
  
  <p>edit 2:
  So basically I have an Excel file with IBAN and I extract with:</p>
  
  <pre><code>function conversion($file){
      require_once '../../PHPExcel-1.8/Classes/PHPExcel/IOFactory.php';
      $objPHPExcel = PHPExcel_IOFactory::load($file);
      $sheet = $objPHPExcel-&gt;getSheet(0);
      $column = convert($sheet-&gt;getHighestColumn());
      $row = $sheet-&gt;getHighestRow();
      for($i=0; $i&lt;$column; $i++){ 
          for($j=1; $j&lt;=$row; $j++){
              $table[$i][$j-1]= $sheet-&gt;getCellByColumnAndRow($i,$j);
          }
      }
      return $table;
  }
  </code></pre>
  
  <p>Then I test $table with an other function element by element to see if the IBAN is correct and return $table_iban_out witch contains null if the IBAN is wrong and the IBAN if the IBAN is correct.</p>