src/Support/Path.php
/**
	 * Joins two or more paths together, separating them with the system's directory separator.
	 *
	 * @param string $path,...
	 * @return string
	 */
Joins two or more paths together, separating them with the system's directory separator.
@param string $path,
@return string
Joins two or more paths together separating them with the system ' s directory separator . @param string $path @return string
public static function join() {
		$paths = func_get_args();
		$path = array_shift($paths);
		foreach ($paths as $i => $segment) {
			while (strlen($segment) > 0 && substr($segment, 0, 1) == '\\' || substr($segment, 0, 1) == '/') {
				$segment = substr($segment, 1);
			}
			if (empty($segment)) {
				continue;
			}
			$path = rtrim($path, '/\\');
			$path .= DIRECTORY_SEPARATOR . $segment;
		}
		$path = str_replace(array('/', '\\'), array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR), $path);
		return static::makeProperPath($path);
	}
public static function join ( ) { $ paths = func_get_args ( ) ; $ path = array_shift ( $ paths ) ; foreach ( $ paths as $ i => $ segment ) { while ( strlen ( $ segment ) > 0 && substr ( $ segment , 0 , 1 ) == '\\' || substr ( $ segment , 0 , 1 ) == '/' ) { $ segment = substr ( $ segment , 1 ) ; } if ( empty ( $ segment ) ) { continue ; } $ path = rtrim ( $ path , '/\\' ) ; $ path .= DIRECTORY_SEPARATOR . $ segment ; } $ path = str_replace ( array ( '/' , '\\' ) , array ( DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR ) , $ path ) ; return static :: makeProperPath ( $ path ) ; }
Joins two or more paths together, separating them with the system's directory separator.
Joins two or more paths together separating them with the system ' s directory separator .