| @@ 122-131 (lines=10) @@ | ||
| 119 | * @param string|array $needles |
|
| 120 | * @return bool |
|
| 121 | */ |
|
| 122 | public static function endsWith($haystack, $needles) |
|
| 123 | { |
|
| 124 | foreach ((array) $needles as $needle) { |
|
| 125 | if (substr($haystack, -strlen($needle)) === (string) $needle) { |
|
| 126 | return true; |
|
| 127 | } |
|
| 128 | } |
|
| 129 | ||
| 130 | return false; |
|
| 131 | } |
|
| 132 | ||
| 133 | /** |
|
| 134 | * Cap a string with a single instance of a given value. |
|
| @@ 486-495 (lines=10) @@ | ||
| 483 | * @param string|array $needles |
|
| 484 | * @return bool |
|
| 485 | */ |
|
| 486 | public static function startsWith($haystack, $needles) |
|
| 487 | { |
|
| 488 | foreach ((array) $needles as $needle) { |
|
| 489 | if ($needle !== '' && substr($haystack, 0, strlen($needle)) === (string) $needle) { |
|
| 490 | return true; |
|
| 491 | } |
|
| 492 | } |
|
| 493 | ||
| 494 | return false; |
|
| 495 | } |
|
| 496 | ||
| 497 | /** |
|
| 498 | * Convert a value to studly caps case. |
|