If I use preg_match to find text between tags like this:
preg_match("/<title>([\d\D]*)<\/title>/", $subject, $str);
preg_match will only return the text between the title tags, but if I use preg_replace:
$change_text = preg_replace("/<title>([\d\D]*)<\/title>/", $new_text, $subject);
then the title tags are also replaced with $new_text. How would I just replace text between the tags?