Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wrap_text($string = "") {
- //Replace all multiple new lines with one
- $string = preg_replace('"(\r?\n){2,}"', "\n\n", $string);
- //Replace multiple spaces, tabs with single space
- $string = preg_replace('"/(\t| ){2,}/"', "$1", $string);
- return $string;
- }
Advertisement
Add Comment
Please, Sign In to add comment