Str::is

Posted on November 25, 2016

The Str::is function determines if a given string matches a given pattern. Asterisks may be used to indicate wildcards.

Use the asterisk to indicate that more chars are before or after the $pattern we are searching for so you can have a match.

Example usage

$value = Str::is('foo*', 'foobar');
// true

$value = Str::is('baz*', 'foobar');
// false

$value = Str::is('*is*', 'LolitaFramework is really awesome');
// true

Parameters

string $pattern

string $value

Return Value

bool

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *