Skip to content

Instantly share code, notes, and snippets.

@ctrl-freak
Created July 21, 2011 04:48
Show Gist options
  • Save ctrl-freak/1096512 to your computer and use it in GitHub Desktop.
Save ctrl-freak/1096512 to your computer and use it in GitHub Desktop.
Truncate String and Word Wrap
<?
preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, 201));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment