Str::startsWith

Posted on November 25, 2016

The Str::startsWith function determines if the given string begins with the given value.

The second parameter can be a string or an array of strings. If it is a string the method returns true or false accordingly by checking in a case-sensitive manner. In case we pass an array of strings then the method returns true as long as one of the strings is the correct one.

Example usage


$value = Str::startsWith('Lolita Framework is really awesome', 'lolita');

// false

Parameters

string $haystack

string|array $needles

Return Value

bool

0 Comments

Leave a Reply

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