3v4l.org

run code in 300+ PHP versions simultaneously
<?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>

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
150.05 ms | 1865 KiB | 9 Q