public static function format($string, $format, $separator = '/')
	{
		// Trim
		$string = trim($string, $separator);
		
		// Empty path case
		if ($string === '') {
			if ($format == self::FORMAT_BOTH_DELIMITERS) {
				return $separator;
			} else {
				return $string;
			}
		}
		
		// Add delimiters
		if ($format & self::FORMAT_LEFT_DELIMITER) {
			$string = $separator . $string;
		}
		if ($format & self::FORMAT_RIGHT_DELIMITER) {
			$string = $string . $separator;
		}
		
		return $string;
	}
public static function format($string, $format, $separator = '/')
	{
		// Trim
		$string = trim($string, $separator);
		
		// Empty path case
		if ($string === '') {
			if ($format == self::FORMAT_BOTH_DELIMITERS) {
				return $separator;
			} else {
				return $string;
			}
		}
		
		// Add delimiters
		if ($format & self::FORMAT_LEFT_DELIMITER) {
			$string = $separator . $string;
		}
		if ($format & self::FORMAT_RIGHT_DELIMITER) {
			$string = $string . $separator;
		}
		
		return $string;
	}
public static function format ( $ string , $ format , $ separator = '/' ) { // Trim $ string = trim ( $ string , $ separator ) ; // Empty path case if ( $ string === '' ) { if ( $ format == self :: FORMAT_BOTH_DELIMITERS ) { return $ separator ; } else { return $ string ; } } // Add delimiters if ( $ format & self :: FORMAT_LEFT_DELIMITER ) { $ string = $ separator . $ string ; } if ( $ format & self :: FORMAT_RIGHT_DELIMITER ) { $ string = $ string . $ separator ; } return $ string ; }
Formats the path string according to the mode
@param string $string
@param integer $format
Formats the path string according to the mode