3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'blahblah<del>blahblah</del>blahblah'; echo preg_replace_callback('~<del>(.*?)</del>~', function($match) { $replace = str_repeat(' ', mb_strlen($match[1])); return $replace; }, $string);

preferences:
48.21 ms | 402 KiB | 5 Q