src/Support/Str.php
/**
	 * Joins two or more strings together by spaces, ignoring blank or empty strings (or those only consisting of
	 * whitespace), and preventing duplicate spaces.
	 *
	 * @param string $one
	 * @param string $two,...
	 * @return string
	 */
Joins two or more strings together by spaces, ignoring blank or empty strings (or those only consisting of
whitespace), and preventing duplicate spaces.


Joins two or more strings together by spaces ignoring blank or empty strings ( or those only consisting of whitespace ) and preventing duplicate spaces .
public static function join() {
		$segments = func_get_args();
		if (count($segments) == 1 && is_array($segments[0])) {
			$segments = $segments[0];
		}
		$string = trim(array_shift($segments));
		foreach ($segments as $segment) {
			$segment = trim($segment);
			if ($segment !== '') {
				$string .= ' ' . $segment;
			}
		}
		return $string;
	}
public static function join ( ) { $ segments = func_get_args ( ) ; if ( count ( $ segments ) == 1 && is_array ( $ segments [ 0 ] ) ) { $ segments = $ segments [ 0 ] ; } $ string = trim ( array_shift ( $ segments ) ) ; foreach ( $ segments as $ segment ) { $ segment = trim ( $ segment ) ; if ( $ segment !== '' ) { $ string .= ' ' . $ segment ; } } return $ string ; }
Joins two or more strings together by spaces, ignoring blank or empty strings (or those only consisting of
 whitespace), and preventing duplicate spaces.
Joins two or more strings together by spaces ignoring blank or empty strings ( or those only consisting of whitespace ) and preventing duplicate spaces .