whoami7 - Manager
:
/
home
/
kckglobal
/
www
/
portal
/
vendor
/
azjezz
/
psl
/
src
/
Psl
/
Str
/
Grapheme
/
Upload File:
files >> /home/kckglobal/www/portal/vendor/azjezz/psl/src/Psl/Str/Grapheme/ends_with_ci.php
<?php declare(strict_types=1); namespace Psl\Str\Grapheme; use Psl\Str\Exception; /** * Returns whether the string ends with the given suffix (case-insensitive). * * @pure * * @throws Exception\InvalidArgumentException If $string is not made of grapheme clusters. */ function ends_with_ci(string $string, string $suffix): bool { if ($suffix === $string) { return true; } $suffix_length = length($suffix); $total_length = length($string); if ($suffix_length > $total_length) { return false; } /** @psalm-suppress MissingThrowsDocblock */ $position = search_last_ci($string, $suffix); if (null === $position) { return false; } return $position + $suffix_length === $total_length; }
Copyright ©2021 || Defacer Indonesia