Automattic\WooCommerce\Vendor\Symfony\Polyfill\Php80
Php80::str_ends_with
Метод класса: Php80{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = Php80::str_ends_with( $haystack, $needle ): bool;
- $haystack(строка) (обязательный)
- .
- $needle(строка) (обязательный)
- .
Код Php80::str_ends_with() Php80::str ends with WC 11.2.1
public static function str_ends_with(string $haystack, string $needle): bool
{
if ('' === $needle || $needle === $haystack) {
return true;
}
if ('' === $haystack) {
return false;
}
$needleLength = \strlen($needle);
return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
}