| @@ 4815-4832 (lines=18) @@ | ||
| 4812 | * |
|
| 4813 | * @return bool <p>Whether or not $str starts with $substring.</p> |
|
| 4814 | */ |
|
| 4815 | public static function str_istarts_with_any(string $str, array $substrings): bool |
|
| 4816 | { |
|
| 4817 | if (!isset($str[0])) { |
|
| 4818 | return false; |
|
| 4819 | } |
|
| 4820 | ||
| 4821 | if (empty($substrings)) { |
|
| 4822 | return false; |
|
| 4823 | } |
|
| 4824 | ||
| 4825 | foreach ($substrings as $substring) { |
|
| 4826 | if (self::str_istarts_with($str, $substring)) { |
|
| 4827 | return true; |
|
| 4828 | } |
|
| 4829 | } |
|
| 4830 | ||
| 4831 | return false; |
|
| 4832 | } |
|
| 4833 | ||
| 4834 | /** |
|
| 4835 | * Limit the number of characters in a string, but also after the next word. |
|
| @@ 5134-5151 (lines=18) @@ | ||
| 5131 | * |
|
| 5132 | * @return bool <p>Whether or not $str starts with $substring.</p> |
|
| 5133 | */ |
|
| 5134 | public static function str_starts_with_any(string $str, array $substrings): bool |
|
| 5135 | { |
|
| 5136 | if (!isset($str[0])) { |
|
| 5137 | return false; |
|
| 5138 | } |
|
| 5139 | ||
| 5140 | if (empty($substrings)) { |
|
| 5141 | return false; |
|
| 5142 | } |
|
| 5143 | ||
| 5144 | foreach ($substrings as $substring) { |
|
| 5145 | if (self::str_starts_with($str, $substring)) { |
|
| 5146 | return true; |
|
| 5147 | } |
|
| 5148 | } |
|
| 5149 | ||
| 5150 | return false; |
|
| 5151 | } |
|
| 5152 | ||
| 5153 | /** |
|
| 5154 | * Get a binary representation of a specific string. |
|