| @@ 4792-4803 (lines=12) @@ | ||
| 4789 | * |
|
| 4790 | * @return bool |
|
| 4791 | */ |
|
| 4792 | public static function str_istarts_with(string $haystack, string $needle): bool |
|
| 4793 | { |
|
| 4794 | if (!isset($haystack[0], $needle[0])) { |
|
| 4795 | return false; |
|
| 4796 | } |
|
| 4797 | ||
| 4798 | if (self::stripos($haystack, $needle) === 0) { |
|
| 4799 | return true; |
|
| 4800 | } |
|
| 4801 | ||
| 4802 | return false; |
|
| 4803 | } |
|
| 4804 | ||
| 4805 | /** |
|
| 4806 | * Returns true if the string begins with any of $substrings, false otherwise. |
|
| @@ 5111-5122 (lines=12) @@ | ||
| 5108 | * |
|
| 5109 | * @return bool |
|
| 5110 | */ |
|
| 5111 | public static function str_starts_with(string $haystack, string $needle): bool |
|
| 5112 | { |
|
| 5113 | if (!isset($haystack[0], $needle[0])) { |
|
| 5114 | return false; |
|
| 5115 | } |
|
| 5116 | ||
| 5117 | if (\strpos($haystack, $needle) === 0) { |
|
| 5118 | return true; |
|
| 5119 | } |
|
| 5120 | ||
| 5121 | return false; |
|
| 5122 | } |
|
| 5123 | ||
| 5124 | /** |
|
| 5125 | * Returns true if the string begins with any of $substrings, false otherwise. |
|