title: PHP trim() doesn't work well
body: <p><code>trim()</code> doesnt't work, I have no idea why. I adding model is not important, sorry for the first add.</p>
  
  <p>When I run it and load row with <code>123 123 123</code> from Excel, this doesn't make me <code>123123123</code></p>
  
  <p>How can I fix it?</p>
  
  <p>If you will need the model, please write a comment.</p>
  
  <p><strong>PHP a bit controller</strong></p>
  
  <pre><code>class Kontroler extends CI_Controller {
  
      public function upload()
      {
          $file = 'przyklad kk.xls';
          $this-&gt;load-&gt;library('excel');
          $this-&gt;excel=PHPExcel_IOFactory::load($file);  
          $this-&gt;excel-&gt;setActiveSheetIndex(0);
          $array = $this-&gt;excel-&gt;getActiveSheet()-&gt;toArray(null, true, true, true);
  
          for ($i = 2; $i &lt;= count($array); $i++) {
              if ($array[$i]['A'] == NULL) $array[$i]['A'] = 'Brak';
              if ($array[$i]['B'] == NULL) $array[$i]['B'] = 'Brak';
              if ($array[$i]['C'] == NULL) $array[$i]['C'] = '00-000';
              if ($array[$i]['F'] == NULL) $array[$i]['F'] = 'Brak';
              if ($array[$i]['G'] == NULL) $array[$i]['G'] = 'Brak';
              if ($array[$i]['D'] == NULL) $array[$i]['D'] = 'Brak';
              if ($array[$i]['H'] == NULL) $array[$i]['H'] = 'Brak';
              if ($array[$i]['E'] == NULL) $array[$i]['E'] = 'Brak';
              if ($array[$i]['J'] == NULL) $array[$i]['J'] = 'Brak';
              if ($array[$i]['I'] == NULL) $array[$i]['I'] = 'brak@brak.pl';
              if ($array[$i]['N'] == NULL) $array[$i]['N'] = 'Brak';
  
              $tab[$i]['City'] = $array[$i]['D'];
              $tab[$i]['ContactPersonName'] = $array[$i]['F'];
              $tab[$i]['ContactPersonSubname'] = $array[$i]['G'];
              $tab[$i]['Email'] = $array[$i]['I'];
              $tab[$i]['Name'] = $array[$i]['A'];
              $tab[$i]['Phone'] = $array[$i]['H'];
              $tab[$i]['PostCode'] = $array[$i]['C'];
              $tab[$i]['Potential'] = $array[$i]['J'];
              $tab[$i]['Powiat'] = $array[$i]['E'];
              $tab[$i]['Street'] = $array[$i]['B'];
              $tab[$i]['ID_GR'] = $array[$i]['L'];
              $tab[$i]['ID_RM'] = $array[$i]['M'];
              $tab[$i]['ID_PR'] = $array[$i]['N'];    
  
              $Name = trim($array[$i]['A']);
              $Street = trim($array[$i]['B']);
              $PostCode = trim($array[$i]['C']);
              $City = trim($array[$i]['D']);
              $ContactPersonName = trim($array[$i]['F']);
              $ContactPersonSubname = trim($array[$i]['G']);
              $Email = trim($array[$i]['I']);
              $Name = trim($array[$i]['D']);
              $Phone = trim($tab[$i]['Phone']);
              $Powiat = trim($array[$i]['E']);
              $Potential = trim($array[$i]['J']);         
              $ID_GR = trim($tab[$i]['ID_GR']);
              $ID_RM = trim($array[$iQ]['M']);
              $ID_PR = trim($array[$i]['N']);             
          }
          $this-&gt;model-&gt;insert_from_file_kk($tab);
      }
  
      public function show()
      {
          $data['rekordy'] = $this-&gt;model-&gt;get_rek();
          $this-&gt;load-&gt;view('widok', $data);
      }
  }
  </code></pre>
  
  <p><strong>PHP view</strong></p>
  
  <pre><code>&lt;div id="content"&gt;
  &lt;table border=1&gt;
  &lt;tr&gt;
  &lt;td&gt;Nazwa&lt;/td&gt;&lt;td&gt;Ulica&lt;/td&gt;&lt;td&gt;Kod pocztowy&lt;/td&gt;&lt;td&gt;Miasto&lt;/td&gt;&lt;td&gt;Powiat&lt;/td&gt;&lt;td&gt;Imie os kontaktowej&lt;/td&gt;&lt;td&gt;Nazwisko os kontaktowej&lt;/td&gt;&lt;td&gt;Telefon&lt;/td&gt;&lt;td&gt;Email&lt;/td&gt;     &lt;td&gt;Potencjal&lt;/td&gt;
  &lt;td&gt;ID_PR&lt;/td&gt;&lt;td&gt;ID_GR&lt;/td&gt;&lt;td&gt;ID_RM&lt;/td&gt;
  &lt;/tr&gt;
  &lt;?php
  
  foreach ($rekordy as $rekord)
  {
      echo "
      &lt;tr&gt;
      &lt;td&gt;$rekord-&gt;Name&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;Street&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;PostCode&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;City&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;Powiat&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;ContactPersonName&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;ContactPersonSubname&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;Phone&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;Email&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;Potential&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;ID_PR&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;ID_GR&lt;/td&gt;
      &lt;td&gt;$rekord-&gt;ID_RM&lt;/td&gt;
      &lt;/tr&gt;
  ";
  
  }
  
  ?&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>