$inject = ""; if (strpos($html, "arena-filter") === false) { $html = str_replace("", $inject . "\n", $html); } echo $html;