Use backreferences (i.e. brackets) to keep only the parts of the expression that you want to remember. You can recall the contents in the replacement string by using $1, $2, etc.:
preg_replace('/(text1)text2(text3)/is','$1$2',$html);
Use backreferences (i.e. brackets) to keep only the parts of the expression that you want to remember. You can recall the contents in the replacement string by using $1, $2, etc.:
preg_replace('/(text1)text2(text3)/is','$1$2',$html);