function getTextBetweenTags($string, $tagname) { $pattern = "/<$tagname ?.*>(.*)<\/$tagname>/"; preg_match($pattern, $string, $matches); return $matches[1]; } This entry was posted in PHP. Bookmark the permalink. Please Post Your Comments & ReviewsYour email address will not be published. Required fields are marked * Save my name, email, and website in this browser for the next time I comment.