$str = \'some text tag contents more text \';
My questions are: How to retrieve content tag contents which is between
tag contents
If MY_TAG can not be nested, try this to get the matches:
MY_TAG
preg_match_all('/(.*?)<\/MY_TAG>/s', $str, $matches)
And to remove them, use preg_replace instead.