April 2015
Beginner
144 pages
3h 13m
English
The string manipulation functions are found in the Illuminate\Support namespace and are callable on the Str object.
Most of the functions also have shorter snake_case aliases. For example, the Str::endsWith() method is identical to the global ends_with() function. We are free to use whichever one we prefer in our application.
The following functions return the true or false values:
is method checks whether a value matches a pattern. The asterisk can be used as a wildcard character as shown here:Str::is('projects/*', 'projects/php/'); // Returns truecontains method, as shown in the following code, checks whether a string contains a given substring:Str::contains('Getting Started With Laravel', 'Python'); ...Read now
Unlock full access