| @@ 4539-4553 (lines=15) @@ | ||
| 4536 | * |
|
| 4537 | * @return bool |
|
| 4538 | */ |
|
| 4539 | public static function str_iends_with($haystack, $needle) |
|
| 4540 | { |
|
| 4541 | $haystack = (string)$haystack; |
|
| 4542 | $needle = (string)$needle; |
|
| 4543 | ||
| 4544 | if (!isset($haystack[0], $needle[0])) { |
|
| 4545 | return false; |
|
| 4546 | } |
|
| 4547 | ||
| 4548 | if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) { |
|
| 4549 | return true; |
|
| 4550 | } |
|
| 4551 | ||
| 4552 | return false; |
|
| 4553 | } |
|
| 4554 | ||
| 4555 | /** |
|
| 4556 | * Case-insensitive and UTF-8 safe version of <function>str_replace</function>. |
|
| @@ 4607-4621 (lines=15) @@ | ||
| 4604 | * |
|
| 4605 | * @return bool |
|
| 4606 | */ |
|
| 4607 | public static function str_istarts_with($haystack, $needle) |
|
| 4608 | { |
|
| 4609 | $haystack = (string)$haystack; |
|
| 4610 | $needle = (string)$needle; |
|
| 4611 | ||
| 4612 | if (!isset($haystack[0], $needle[0])) { |
|
| 4613 | return false; |
|
| 4614 | } |
|
| 4615 | ||
| 4616 | if (self::stripos($haystack, $needle) === 0) { |
|
| 4617 | return true; |
|
| 4618 | } |
|
| 4619 | ||
| 4620 | return false; |
|
| 4621 | } |
|
| 4622 | ||
| 4623 | /** |
|
| 4624 | * Limit the number of characters in a string, but also after the next word. |
|
| @@ 4893-4907 (lines=15) @@ | ||
| 4890 | * |
|
| 4891 | * @return bool |
|
| 4892 | */ |
|
| 4893 | public static function str_starts_with($haystack, $needle) |
|
| 4894 | { |
|
| 4895 | $haystack = (string)$haystack; |
|
| 4896 | $needle = (string)$needle; |
|
| 4897 | ||
| 4898 | if (!isset($haystack[0], $needle[0])) { |
|
| 4899 | return false; |
|
| 4900 | } |
|
| 4901 | ||
| 4902 | if (self::strpos($haystack, $needle) === 0) { |
|
| 4903 | return true; |
|
| 4904 | } |
|
| 4905 | ||
| 4906 | return false; |
|
| 4907 | } |
|
| 4908 | ||
| 4909 | /** |
|
| 4910 | * Get a binary representation of a specific string. |
|