| @@ 699-717 (lines=19) @@ | ||
| 696 | } |
|
| 697 | } |
|
| 698 | ||
| 699 | if ( ! function_exists('starts_with')) |
|
| 700 | { |
|
| 701 | /** |
|
| 702 | * Determine if a given string starts with a given substring. |
|
| 703 | * |
|
| 704 | * @param string $haystack |
|
| 705 | * @param string|array $needles |
|
| 706 | * @return bool |
|
| 707 | */ |
|
| 708 | function starts_with($haystack, $needles) |
|
| 709 | { |
|
| 710 | foreach ((array) $needles as $needle) |
|
| 711 | { |
|
| 712 | if ($needle != '' && strpos($haystack, $needle) === 0) return true; |
|
| 713 | } |
|
| 714 | ||
| 715 | return false; |
|
| 716 | } |
|
| 717 | } |
|
| 718 | ||
| 719 | if ( ! function_exists('str_contains')) |
|
| 720 | { |
|
| @@ 719-737 (lines=19) @@ | ||
| 716 | } |
|
| 717 | } |
|
| 718 | ||
| 719 | if ( ! function_exists('str_contains')) |
|
| 720 | { |
|
| 721 | /** |
|
| 722 | * Determine if a given string contains a given substring. |
|
| 723 | * |
|
| 724 | * @param string $haystack |
|
| 725 | * @param string|array $needles |
|
| 726 | * @return bool |
|
| 727 | */ |
|
| 728 | function str_contains($haystack, $needles) |
|
| 729 | { |
|
| 730 | foreach ((array) $needles as $needle) |
|
| 731 | { |
|
| 732 | if ($needle != '' && strpos($haystack, $needle) !== false) return true; |
|
| 733 | } |
|
| 734 | ||
| 735 | return false; |
|
| 736 | } |
|
| 737 | } |
|
| 738 | ||
| 739 | if ( ! function_exists('str_finish')) |
|
| 740 | { |
|