src/UString.php
public static function substrBefore( $haystack, $needles ) {
		\UArray::doConvertToArray( $needles );
		$result = $haystack;
		foreach( $needles as $needle ) {
			if ( ! empty( $needle) && \UString::has( $haystack, $needle ) ) {
				$cut = substr( $haystack, 0, strpos( $haystack, $needle ) );
				if ( strlen( $cut ) < strlen ( $result ) ) {
					$result = $cut;
				}
			}
		}
		$haystack = substr( $haystack, strlen( $result ) );
		return $result;
	}
public static function substrBefore( $haystack, $needles ) {
		\UArray::doConvertToArray( $needles );
		$result = $haystack;
		foreach( $needles as $needle ) {
			if ( ! empty( $needle) && \UString::has( $haystack, $needle ) ) {
				$cut = substr( $haystack, 0, strpos( $haystack, $needle ) );
				if ( strlen( $cut ) < strlen ( $result ) ) {
					$result = $cut;
				}
			}
		}
		$haystack = substr( $haystack, strlen( $result ) );
		return $result;
	}
public static function substrBefore ( $ haystack , $ needles ) { \ UArray :: doConvertToArray ( $ needles ) ; $ result = $ haystack ; foreach ( $ needles as $ needle ) { if ( ! empty ( $ needle ) && \ UString :: has ( $ haystack , $ needle ) ) { $ cut = substr ( $ haystack , 0 , strpos ( $ haystack , $ needle ) ) ; if ( strlen ( $ cut ) < strlen ( $ result ) ) { $ result = $ cut ; } } } $ haystack = substr ( $ haystack , strlen ( $ result ) ) ; return $ result ; }
***********************************************************************
SUBSTRING METHODS
***********************************************************************
*********************************************************************** SUBSTRING METHODS ***********************************************************************