$str = \'some text tag contents more text \';
My questions are:
How to retrieve content tag contents
which is between
Although the only fully correct way to do this is not to use regular expressions, you can get what you want if you accept it won't handle all special cases:
preg_match("/]*?>.*?/i", $str, $match);
// Use this only if you aren't worried about nested tags.
// It will handle tags with attributes
And
preg_replace(""/]*?>.*? /i", "", $str);