3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '<p id="keepthis"> text</p><div id="foo">text</div><div id="bar">more text</div><a id="red"href="page6.php">Page 6</a><a id="green"href="page7.php">Page 7</a>'; echo preg_replace_callback( '/(?<=<div|<a)( *id="[^"]+")/', function ($match) { return " "; }, $string );

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
163.42 ms | 2682 KiB | 11 Q