| @@ 4451-4465 (lines=15) @@ | ||
| 4448 | * |
|
| 4449 | * @return bool |
|
| 4450 | */ |
|
| 4451 | public static function str_iends_with($haystack, $needle) |
|
| 4452 | { |
|
| 4453 | $haystack = (string)$haystack; |
|
| 4454 | $needle = (string)$needle; |
|
| 4455 | ||
| 4456 | if (!isset($haystack[0], $needle[0])) { |
|
| 4457 | return false; |
|
| 4458 | } |
|
| 4459 | ||
| 4460 | if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) { |
|
| 4461 | return true; |
|
| 4462 | } |
|
| 4463 | ||
| 4464 | return false; |
|
| 4465 | } |
|
| 4466 | ||
| 4467 | /** |
|
| 4468 | * Case-insensitive and UTF-8 safe version of <function>str_replace</function>. |
|
| @@ 4519-4533 (lines=15) @@ | ||
| 4516 | * |
|
| 4517 | * @return bool |
|
| 4518 | */ |
|
| 4519 | public static function str_istarts_with($haystack, $needle) |
|
| 4520 | { |
|
| 4521 | $haystack = (string)$haystack; |
|
| 4522 | $needle = (string)$needle; |
|
| 4523 | ||
| 4524 | if (!isset($haystack[0], $needle[0])) { |
|
| 4525 | return false; |
|
| 4526 | } |
|
| 4527 | ||
| 4528 | if (self::stripos($haystack, $needle) === 0) { |
|
| 4529 | return true; |
|
| 4530 | } |
|
| 4531 | ||
| 4532 | return false; |
|
| 4533 | } |
|
| 4534 | ||
| 4535 | /** |
|
| 4536 | * Limit the number of characters in a string, but also after the next word. |
|
| @@ 4805-4819 (lines=15) @@ | ||
| 4802 | * |
|
| 4803 | * @return bool |
|
| 4804 | */ |
|
| 4805 | public static function str_starts_with($haystack, $needle) |
|
| 4806 | { |
|
| 4807 | $haystack = (string)$haystack; |
|
| 4808 | $needle = (string)$needle; |
|
| 4809 | ||
| 4810 | if (!isset($haystack[0], $needle[0])) { |
|
| 4811 | return false; |
|
| 4812 | } |
|
| 4813 | ||
| 4814 | if (self::strpos($haystack, $needle) === 0) { |
|
| 4815 | return true; |
|
| 4816 | } |
|
| 4817 | ||
| 4818 | return false; |
|
| 4819 | } |
|
| 4820 | ||
| 4821 | /** |
|
| 4822 | * Get a binary representation of a specific string. |
|