String Contains String Laravel

[Solved] String Contains String Laravel | Php - Code Explorer | yomemimo.com
Question : string contains string laravel

Answered by : snippets

// **** 1
$str = "Hello World!";
// String contains the given value
$contains = str_contains($str, 'World');
// Array of values
$contains = str_contains($str, ['Hi', 'World']);
// **** 2
use Illuminate\Support\Str;
$str = "Hello World!";
$contains = Str::contains($str, 'World');

Source : | Last Update : Wed, 02 Mar 22

Answers related to string contains string laravel

Code Explorer Popular Question For Php