| @@ 4532-4546 (lines=15) @@ | ||
| 4529 | * |
|
| 4530 | * @return bool |
|
| 4531 | */ |
|
| 4532 | public static function str_iends_with($haystack, $needle) |
|
| 4533 | { |
|
| 4534 | $haystack = (string)$haystack; |
|
| 4535 | $needle = (string)$needle; |
|
| 4536 | ||
| 4537 | if (!isset($haystack[0], $needle[0])) { |
|
| 4538 | return false; |
|
| 4539 | } |
|
| 4540 | ||
| 4541 | if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) { |
|
| 4542 | return true; |
|
| 4543 | } |
|
| 4544 | ||
| 4545 | return false; |
|
| 4546 | } |
|
| 4547 | ||
| 4548 | /** |
|
| 4549 | * Case-insensitive and UTF-8 safe version of <function>str_replace</function>. |
|
| @@ 4600-4614 (lines=15) @@ | ||
| 4597 | * |
|
| 4598 | * @return bool |
|
| 4599 | */ |
|
| 4600 | public static function str_istarts_with($haystack, $needle) |
|
| 4601 | { |
|
| 4602 | $haystack = (string)$haystack; |
|
| 4603 | $needle = (string)$needle; |
|
| 4604 | ||
| 4605 | if (!isset($haystack[0], $needle[0])) { |
|
| 4606 | return false; |
|
| 4607 | } |
|
| 4608 | ||
| 4609 | if (self::stripos($haystack, $needle) === 0) { |
|
| 4610 | return true; |
|
| 4611 | } |
|
| 4612 | ||
| 4613 | return false; |
|
| 4614 | } |
|
| 4615 | ||
| 4616 | /** |
|
| 4617 | * Limit the number of characters in a string, but also after the next word. |
|
| @@ 4886-4900 (lines=15) @@ | ||
| 4883 | * |
|
| 4884 | * @return bool |
|
| 4885 | */ |
|
| 4886 | public static function str_starts_with($haystack, $needle) |
|
| 4887 | { |
|
| 4888 | $haystack = (string)$haystack; |
|
| 4889 | $needle = (string)$needle; |
|
| 4890 | ||
| 4891 | if (!isset($haystack[0], $needle[0])) { |
|
| 4892 | return false; |
|
| 4893 | } |
|
| 4894 | ||
| 4895 | if (self::strpos($haystack, $needle) === 0) { |
|
| 4896 | return true; |
|
| 4897 | } |
|
| 4898 | ||
| 4899 | return false; |
|
| 4900 | } |
|
| 4901 | ||
| 4902 | /** |
|
| 4903 | * Get a binary representation of a specific string. |
|