Skip to content

Instantly share code, notes, and snippets.

@turtlix
Created July 10, 2014 07:45
Show Gist options
  • Save turtlix/564d9dc0c85a9119a266 to your computer and use it in GitHub Desktop.
Save turtlix/564d9dc0c85a9119a266 to your computer and use it in GitHub Desktop.
// With PHP
$text = preg_replace( '|([^\s])\s+([^\s]+)\s*$|', '$1 $2', $text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment