Web Analytics Made Easy -
StatCounter string function help - CodingForum

Announcement

Collapse
No announcement yet.

string function help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • string function help

    I need help with a string function.

    I want to take a string and add a space after each 4 digits to make it more readable.

    so abcdefghijklmnop should be
    abcd efgh ijkl mnop

    can someone help me with the code?

    Thanks

  • #2
    PHP Code:
    <?php
    $string 
    '12341234123412341234';
    $s2 chunk_split($string4' ');
    echo 
    $s2;
    ?>

    Comment


    • #3
      thanks!

      Comment

      Working...
      X