title: Divide big string in multiple small one - PHP
body: <p>I am getting some long string from database and I need to parse it to don't have one big string but multiple one where each of them have 2 chars.</p>
  
  <p>Let's make this on example:
  I connect to table, get this string: <code>B1C1F4G6H4I7J1J8L5O6P2Q1R6T5U8V1Z5</code> , after this i have to parse this string on pairs so:</p>
  
  <pre><code>B1 C1 F4 G6 H4 I7 J1 J8 L5 O6 P2 Q1 R6 T5 U8 V1 Z5
  </code></pre>
  
  <p>And do some cycle to insert something to it. (for example add random number at the end of this 2 char string and echo it after)</p>
  
  <p>I was thinking about something like:</p>
  
  <pre><code>$string ="B1C1F4G6H4I7J1J8L5O6P2Q1R6T5U8V1Z5";
  $string1 = substr($string,0,2);
  $string2 = substr($string,2,3);
  </code></pre>
  
  <p>But i beleiave there is some easier way how to do it, also my method is a problem when i don't know how long the string will be.</p>
  
  <p>Thank you for any advise.</p>