normalize_whitespace( string $str )
Normalize EOL characters and strip duplicate whitespace.
Description Description
Parameters Parameters
- $str
-
(string) (Required) The string to normalize.
Return Return
(string) The normalized string.
Source Source
File: wp-includes/formatting.php
function normalize_whitespace( $str ) { $str = trim( $str ); $str = str_replace( "\r", "\n", $str ); $str = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str ); return $str; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |