<?php $string = 'somenametofind|alinktoimages_icon_047_00.png|some-text'; $searched = array("some-text", "047"); foreach ($searched as $s) { $b = is_numeric($s) ? '\D' : '\b'; if (preg_match("/$b$s$b/i", $string) ) { echo "found $s\n"; } }
You have javascript disabled. You will not be able to edit any code.