title: delete code in string with loop when read PDF with php
body: <p>I´m traying to read PDF file with this <code>library</code>, <code>\Smalot\PdfParser\Parser();</code> in <code>laravel 5.6</code></p>
  <p>i´m reading all my pdf ok, i´m getting all my content ok. i´m deleting headers from my PDF and i´m inserting by line in array.</p>
  <p>and this it´s data:</p>
  <pre><code>    [0] =&gt;  MARTIN CARRILLO MARIA ESMERALDA ALHAMBRA 10 958 54 38 93
      [1] =&gt; 1745591 ESPIGARES DIAS JOSE ANTONIO ALHAMBRA 11 958 54 33 32
      [2] =&gt; 1770062 GUTIERREZ TITOS JOSE MANUEL ALHAMBRA 12 958 54 04 10
      [3] =&gt; 1793228 MARTIN COBOS ANTONIO ALHAMBRA 18 958 54 33 28
      [4] =&gt; 1768807 GOMEZ CARRILLO JOSE ALHAMBRA 20 958 54 32 72
      [5] =&gt; 1830072 RODRIGUEZ RUANO BUENAVENTURA ALHAMBRA 21 958 54 35 86
      [6] =&gt; 1759534 GARCIA ARIAS MARIA ISABEL ALHAMBRA 22 958 54 07 87
      [7] =&gt; 1831938 RODRIGUEZ JIMENEZ MIGUEL ALHAMBRA 27 958 54 08 77
      [8] =&gt; 1722022 GUTIERREZ FERNANDEZ AMANDA HILDA ALHAMBRA 3 958 49 98 62
      [9] =&gt; 1746872 DIAZ FLORIAN DOLORES ALHAMBRA 30 958 54 33 99
      [10] =&gt; 1817587 PEREZ LASTRA SAUL ADAN ALHAMBRA 32 958 54 31 46
      [11] =&gt; 1724006 AMIGO MOLINA MARIA MATILDE ALHAMBRA 35 958 54 31 91
      [12] =&gt; 1745604 ESPIGARES GOMEZ JORGE ALHAMBRA 37 958 54 02 22
      [13] =&gt; 1745595 ESPIGARES ESPIGARES JOSE ALHAMBRA 40 958 54 31 83
  </code></pre>
  <p>i need delete firt numbers, it´s code from this client. i´m doing this for delete code, but always it´s doing in firts element.</p>
  <p>This is my code to tray delete my code from all string...</p>
  <pre><code>// loop to get data line
  for($i=0; $i&lt;count($dataByLine); $i++){
     // delete code
     $numberCode = stripos($dataByLine[$i], &quot; &quot;);
     $codeClear = substr($text, 0, $numberCode);
     $dataByLine = str_replace($codeClear, &quot;&quot;, $dataByLine);
  
     print_r($dataByLine);
  }
  </code></pre>
  <p>this <code>print_r()</code> it´s my first content array. As you can see in my array, first element it´s without code.. but the rest, have code.</p>
  <p>how i can to delete all code from this string¿?</p>
  <p>thanks for help and read. Sorry for my english</p>
  <p><strong>updated</strong></p>
  <pre><code>// loop to get data line
  foreach($dataByLine as &amp;$line){                        
     //$line = preg_replace('/^[\d]+/','',$line);
     $line = ltrim($line,&quot;0123456789&quot;);
  
     array_push($dataList, $line);
  }
  
  print_r($dataList);
  </code></pre>
  <p>this it´s result:</p>
  <pre><code>    [0] =&gt;  1794707 MARTIN CARRILLO MARIA ESMERALDA ALHAMBRA 10 958 54 38 93
      [1] =&gt;  ESPIGARES DIAS JOSE ANTONIO ALHAMBRA 11 958 54 33 32
      [2] =&gt;  GUTIERREZ TITOS JOSE MANUEL ALHAMBRA 12 958 54 04 10
      [3] =&gt;  MARTIN COBOS ANTONIO ALHAMBRA 18 958 54 33 28
      [4] =&gt;  GOMEZ CARRILLO JOSE ALHAMBRA 20 958 54 32 72
      [5] =&gt;  RODRIGUEZ RUANO BUENAVENTURA ALHAMBRA 21 958 54 35 86
      [6] =&gt;  GARCIA ARIAS MARIA ISABEL ALHAMBRA 22 958 54 07 87
      [7] =&gt;  RODRIGUEZ JIMENEZ MIGUEL ALHAMBRA 27 958 54 08 77
      [8] =&gt;  GUTIERREZ FERNANDEZ AMANDA HILDA ALHAMBRA 3 958 49 98 62
      [9] =&gt;  DIAZ FLORIAN DOLORES ALHAMBRA 30 958 54 33 99
  </code></pre>