3v4l.org

run code in 300+ PHP versions simultaneously
<?php function highlightWords($content) { $arr=array("php", "and sql", "sql"); $arr = array_map(function($v){ return "/\b(" . preg_quote($v, "/") . ")\b/i"; }, $arr); print_r($arr); $content=preg_replace($arr, '<a href="#">$1</a>', $content, 1); return $content; } echo highlightWords("This text will highlight PHP and SQL and sql but not PHPRO or MySQL or sqlite");

preferences:
34.96 ms | 402 KiB | 5 Q