November 27, 2017 —John Koster
The after
method can be used to return a part of a string after the first occurrence of a $search
character.
This method can be used to help parse URL query strings, or to quickly find substrings based on a certain character.
The signature of the after
method is:
1public static function after(2 $subject,3 $search4 );
The after
method can be used like so:
1use Illuminate\Support\Str;2 3// Outputs "ref=newsletter"4echo Str::after('https://stillat.com?ref=newsletter', '?');
∎
The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.