23-01-2012, 18:52
Na przykład tak:
Kod PHP:
$str = 'to jest tylko test';
$arr = array('jest','tylko','to');
echo str_exist_arr($str, $arr);
function str_exist_arr($string, $search_array)
{
foreach ($search_array AS $needle)
{
if (strpos($string, $needle) === false)
{
return false;
}
}
return true;
}