@@ 5-14 (lines=10) @@ | ||
2 | ||
3 | namespace Spatie\SslCertificate; |
|
4 | ||
5 | function starts_with($haystack, $needles): bool |
|
6 | { |
|
7 | foreach ((array) $needles as $needle) { |
|
8 | if ($needle != '' && mb_strpos($haystack, $needle) === 0) { |
|
9 | return true; |
|
10 | } |
|
11 | } |
|
12 | ||
13 | return false; |
|
14 | } |
|
15 | ||
16 | /** |
|
17 | * Determine if a given string ends with a given substring. |
|
@@ 69-78 (lines=10) @@ | ||
66 | * |
|
67 | * @return bool |
|
68 | */ |
|
69 | function str_contains(string $haystack, $needles): bool |
|
70 | { |
|
71 | foreach ((array) $needles as $needle) { |
|
72 | if ($needle != '' && mb_strpos($haystack, $needle) !== false) { |
|
73 | return true; |
|
74 | } |
|
75 | } |
|
76 | ||
77 | return false; |
|
78 | } |
|
79 |