Skip to content

Instantly share code, notes, and snippets.

@cirpo
Forked from odracci/gist:505473
Created August 2, 2010 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirpo/505528 to your computer and use it in GitHub Desktop.
Save cirpo/505528 to your computer and use it in GitHub Desktop.
append a carachter after n carachters
<?php
$number = '0123456789394872394';
$match = array();
preg_match_all('/(.{1,3})/', $number, $match);
$res = implode(' ', $match[0]);
var_dump($res);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment