str = "beginabc noreplacefgd end"
temp = mid(str, 6, len(str) - 8)
if instr(temp, "noreplace") then
else
str = "begin" & "xyz" & "end"
end if
temp = mid(str, 6, len(str) - 8)
if instr(temp, "noreplace") then
else
str = "begin" & "xyz" & "end"
end if
{
if (strpos($str,"noreplace") === false)
return "xyz";
else
return $str;
}
$str = "beginabcreplace end";
$str =preg_replace("|(begin)(.+)(end)|e","'\\1'.checkStr('\\2').'\\3'", $str);
echo $str;