[^\S ]+/s', '/[^\S ]+\', '<', '\\1' ); $output = preg_replace( $search, $replace, $input ); $output = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $output ); $output = trim( $output ); return $output; } }