3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "This is some text <p>##IDOBJECT=784##</p> and another some text <p>##IDOBJECT=1509##</p> <p>##LATESTARTICLESHOME=321##</p> <p align=\"center\">##IDOBJECT=321##</p>"; echo preg_replace_callback('/##(.*?)##/', function($match){ return strtolower('[object ' . $match[1] . ']'); }, $str);

preferences:
169.06 ms | 405 KiB | 5 Q