title: PHPEXCEL- how to remove hidden line breaks from cells
body: <p>I'm trying to upload an excel sheet which contains financial data. It has account numbers on column A and when I upload the sheet COL A data comes with "<em>x000D</em>". When I google  this it says something to do with hidden line breaks on cells. Does anybody know how to remove these line breaks from cells? Thanks</p>
  
  <pre><code>function import_data($filename, &amp;$new_chart_accounts, $extension = '') {
      $this-&gt;init_worksheet($filename, $extension);
  
      $entries = array();
      $new_chart_accounts = array();
      $chart_accounts = ChartAccounts::read_all(true);
  
      $cha_description;
      $indent = $this-&gt;dimension[0][0];
      for ($row = $this-&gt;dimension[0][1] + 1; $row &lt; $this-&gt;dimension[1][1]; $row++) {
          $entry = array();
          for ($col = $this-&gt;dimension[0][0]; $col &lt;= $this-&gt;dimension[1][0]; $col++) {
              if ($this-&gt;sheet-&gt;cellExistsByColumnAndRow($col, $row)) {
                  $cell = $this-&gt;sheet-&gt;getCellByColumnAndRow($col, $row);
                  $style = $this-&gt;sheet-&gt;getStyle($cell-&gt;getCoordinate());
                  $fill = $style-&gt;getFill();
                  if ($fill-&gt;getFillType() == PHPExcel_Style_Fill::FILL_NONE 
                          || ($fill-&gt;getFillType() == PHPExcel_Style_Fill::FILL_SOLID &amp;&amp; $fill-&gt;getStartColor()-&gt;getRGB() == 'FFFFFF')) {
  
                      $value = trim($cell-&gt;getValue());
                      //print $value;
                      switch ($col) {
                          case self::ACCOUNT_NUMBER:
                              $entry['cha_number'] = $value;
                              break;
                          case self::ACCOUNT_DESCRIPTION:
                              $entry['cha_description'] = $value;
                              break;
                          case self::AMOUNT:
                          case self::AMOUNT_2:
                              $value = str_replace(array(',', '$'), '', $value);
                              // $sign = substr($value, strlen($value) - 2, 2);
                              // if ($sign == 'cr' || $sign == 'dr') {
                                  // $value = str_replace($sign, '', $value);
                              // } else {
                                  // $sign = 'dr';
                              // }
                              // $entry['sign'] = $sign;
                              // if ($value != '' &amp;&amp; is_numeric($value)) {
                                  // $entry['data_amount'] = $value;
                              // }
              $entry['data_amount'] = $value;
                      }
                  }
              }
          }
  </code></pre>