1 | <?php namespace Gears\String\Methods; |
||
17 | trait Between |
||
18 | { |
||
19 | /** |
||
20 | * Returns the substring between `$start` and `$end`. |
||
21 | * |
||
22 | * An optional offset may be supplied from which |
||
23 | * to begin the search for the start string. |
||
24 | * |
||
25 | * @param string $start Delimiter marking the start of the substring. |
||
26 | * |
||
27 | * @param string $end Delimiter marking the end of the substring. |
||
28 | * |
||
29 | * @param int $offset Index from which to begin the search. |
||
30 | * |
||
31 | * @param bool $include If true, we include the start & end in the result. |
||
32 | * |
||
33 | * @return static Str object between $start & $end. |
||
34 | */ |
||
35 | public function between($start, $end, $offset = 0, $include = false) |
||
57 | |||
58 | /** |
||
59 | * Returns an array of substrings between $start and $end. |
||
60 | * |
||
61 | * @param string $start Delimiter marking the start of the substring. |
||
62 | * |
||
63 | * @param string $end Delimiter marking the end of the substring. |
||
64 | * |
||
65 | * @return static[] |
||
66 | * |
||
67 | * @throws PcreException When PCRE Error occurs. |
||
68 | */ |
||
69 | public function betweenAll($start, $end) |
||
85 | } |
||
86 |