<?php $string = "<tag>i dont know what is here</tag> don't remove this text"; $string = preg_replace('|^<([a-z]*).*|', '<$1></$1>', $string); echo $string; // <tag></tag>
You have javascript disabled. You will not be able to edit any code.