find word in text in laravel
snippet in php

find word in text in laravel

user7045

$string = 'Cassandra is a clean word so it should pass the check';
$blacklistArray = ['ass','ball sack'];

$contains = str_contains($string, $blacklistArray);