Skip to content

Instantly share code, notes, and snippets.

@jakemcgraw
Created July 21, 2010 18:19
Show Gist options
  • Save jakemcgraw/484882 to your computer and use it in GitHub Desktop.
Save jakemcgraw/484882 to your computer and use it in GitHub Desktop.
<?php
$str;
while(true) {
if (preg_match('/^(.{1,60})( |$)/', $str, $match)) {
print $match[1];
$str = substr($str, strlen($match[1]));
}
else {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment