$str="this is a string of text, aa search_string zz sdafdsfdsds";
//$str="this is a string of text, aa search_string zz sdafdsfdsds";
//$str="this is a string of text, aasearch_stringzz sdafdsfdsds";
$search="search_string";
if(preg_match("/$search/i",$str)){
echo "found";
if(preg_match("/aa( )*$search( )*zz/i",$str))
echo "<br>is between aa/zz";
else
echo "<br>it is NOT between aa/zz";
}else
echo "not found";
that would check once if its there, then check if its somewhere between aa/zz (0-many amount of " " inbetween) . instead of the echo you can just set a boolean variable and build from there.
if this is completely off base, just let me know what you plan on using it for so i understand it better