I want to check is long string contains an element from samples, I mean I have a long string
Lorem ipsum dolor 123 SAMPLE sit amet, consectetur.
and in config i have
$samples = array("# SAMPLE","SAMPLE #")
and function should return that on position 19
there is 123 SAMPLE
from # SAMPLE
Use preg_match http://php.net/manual/de/function.preg-match.php to query "Lorem ipsum...". To find your special regex use https://regexr.com/ to try and learn ;) Sthg. like /[0-9].SAMPLE/g