Skip to content

Instantly share code, notes, and snippets.

@odracci
Created August 2, 2010 22:49
Show Gist options
  • Select an option

  • Save odracci/505473 to your computer and use it in GitHub Desktop.

Select an option

Save odracci/505473 to your computer and use it in GitHub Desktop.
<?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