3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "An example of a website would be google.com or similar. However this is not what we are looking for"; $tlds = ['com', 'org', 'net']; echo preg_replace('~\.(?!(?:' . implode('|', $tlds) . ')\b)~i', '?', $string);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
154.28 ms | 2008 KiB | 12 Q