src/Support/Str.php
/**
	 * Determine if a given string matches a given pattern.
	 *
	 * @param string|array $pattern
	 * @param string $value
	 * @return bool
	 */
Determine if a given string matches a given pattern.
@param string|array $pattern
@param string $value
@return bool
Determine if a given string matches a given pattern . @param string|array $pattern @param string $value @return bool
public static function is($pattern, $value) {
		$patterns = is_array($pattern) ? $pattern : (array) $pattern;
		if (empty($patterns)) {
			return false;
		}
		foreach ($patterns as $pattern) {
			if ($pattern == $value) {
				return true;
			}
			$pattern = preg_quote($pattern, '#');
			$pattern = str_replace('\*', '.*', $pattern);
			if (preg_match('#^'.$pattern.'\z#u', $value) === 1) {
				return true;
			}
		}
		return false;
	}
public static function is ( $ pattern , $ value ) { $ patterns = is_array ( $ pattern ) ? $ pattern : ( array ) $ pattern ; if ( empty ( $ patterns ) ) { return false ; } foreach ( $ patterns as $ pattern ) { if ( $ pattern == $ value ) { return true ; } $ pattern = preg_quote ( $ pattern , '#' ) ; $ pattern = str_replace ( '\*' , '.*' , $ pattern ) ; if ( preg_match ( '#^' . $ pattern . '\z#u' , $ value ) === 1 ) { return true ; } } return false ; }
Determine if a given string matches a given pattern.
Determine if a given string matches a given pattern .