We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the following function:
/** * Returns true if the $string starts with one of the $patterns. Otherwise returns false. * * @param string $string The haystack. * @param string|array $patterns The patterns to search for in the beginning of the $string. * * @return bool */ function dfrapi_string_starts_with( $string, $patterns ) { $patterns = ( is_string( $patterns ) ) ? array( $patterns ) : $patterns; foreach ( $patterns as $pattern ) { $length = mb_strlen( $pattern ); if ( mb_substr( $string, 0, $length ) === $pattern ) { return true; } } return false; }
The text was updated successfully, but these errors were encountered:
24ac317
EricBusch
No branches or pull requests
Add the following function:
The text was updated successfully, but these errors were encountered: