3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<div id="test"><p style="hello_world">This is a test.</p></div>'; $readmore = ' <a href="/foo/bar">Read More&hellip;</a>'; // Outputs: // '<div id="test"><p style="hello_world">This is a test.</p> <a href="/foo/bar">Read More&hellip;</a></div>' echo preg_replace('#</\w>\s*$#', $readmore .'$1', $html);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
161.68 ms | 1600 KiB | 9 Q