Automattic\WooCommerce\Utilities
StringUtil::contains()
Checks if one string is contained into another at any position.
Метод класса: StringUtil{}
Хуков нет.
Возвращает
true|false
. True if $contained is contained inside $string, false otherwise.
Использование
$result = StringUtil::contains( $string, $contained, $case_sensitive ): bool;
- $string(строка) (обязательный)
- The string we want to check.
- $contained(строка) (обязательный)
- The string we're looking for inside $string.
- $case_sensitive(true|false)
- Indicates whether the comparison should be case-sensitive.
По умолчанию: true
Код StringUtil::contains() StringUtil::contains WC 7.5.1
public static function contains( string $string, string $contained, bool $case_sensitive = true ): bool { if ( $case_sensitive ) { return false !== strpos( $string, $contained ); } else { return false !== stripos( $string, $contained ); } }