Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function remove_white_spaces( $string = '', $true_trim = true ) {
- $return = '';
- if ( !empty( $string ) ) {
- if ( is_string( $string ) ) {
- $return = preg_replace( '/\s\s+/', ' ', $string );
- if( $true_trim ) {
- $return = trim( $return );
- }
- } else { // is_string
- return array_map( __FUNCTION__ , $string );
- }
- } // empty
- return $return;
- }
Advertisement
Add Comment
Please, Sign In to add comment