Skip to content

Commit 5486c20

Browse files
author
afsardo
committed
Adding the str_before helper to the docs
1 parent d2884d9 commit 5486c20

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

helpers.md

+9
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
7878
[str_limit](#method-str-limit)
7979
[starts_with](#method-starts-with)
8080
[str_after](#method-str-after)
81+
[str_before](#method-str-before)
8182
[str_contains](#method-str-contains)
8283
[str_finish](#method-str-finish)
8384
[str_is](#method-str-is)
@@ -606,6 +607,14 @@ The `str_after` function returns everything after the given value in a string:
606607

607608
// ' a test'
608609

610+
<a name="method-str-before"></a>
611+
#### `str_before()` {#collection-method}
612+
613+
The `str_before` function returns everything before the given value in a string:
614+
615+
$value = str_before('Test :it before', ':it before');
616+
617+
// 'Test '
609618

610619
<a name="method-str-contains"></a>
611620
#### `str_contains()` {#collection-method}

0 commit comments

Comments
 (0)