title: Getting every nth character of a string using php
body: <p>I have a long string that I need to get ever 12th character. I currently do it with a for loop, but I'm wondering if there is a better/more efficient way.  Any advice would be appreciated</p>
  
  <pre><code>$verylongstring='thisisalongstringwithawholelotofcharctersitgoesonforawhile...loremipsum'; 
  $newstring= '';
  
  for($i=0;$i&lt;strlen($verylongstring);$i++) 
  { 
   if($i%12 == 0){
      $newstring .= $verylongstring[$i];
   }
  } 
  
  echo $newstring;
  </code></pre>