title: implode with characters after 6 word in php
body: <p><strong>I have a variable</strong> </p>
  
  <pre><code>$srch_key = '180265180235' ;
  </code></pre>
  
  <p><strong>I want to make this output as</strong> </p>
  
  <pre><code>'180265','180235'
  </code></pre>
  
  <p>That means I want to append those characters after 6 words or numbers. </p>
  
  <p>I have tried this code to make it.</p>
  
  <p><strong>Here is the code</strong> </p>
  
  <pre><code>function ref_format($str, $step, $reverse = false)
  {
      if ($reverse)
          return strrev("'" .  implode("' ,'", str_split($str, $step)) . "'");
      return "'" . implode("','", str_split($str, $step)) . "'";
  }
    $passport = ref_format("$srch_key", 6);
    echo $passport_key = substr($passport, 0, -1); 
  </code></pre>
  
  <p><strong>But The Output was</strong></p>
  
  <pre><code>'180265','180235
  </code></pre>
  
  <p><strong>But I want this output</strong> </p>
  
  <pre><code>'180265','180235'
  </code></pre>
  
  <p>How can I achieve this?</p>