3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Sonance Visual Performance Series features an award-winning <a href="">Visual Performance Series</a> low-profile grille that is paintable to blend into the wall or ceiling. With three shapes and sizes, several performance levels, and a range of Sonance Landscape Series specialty /ThinLine application speakers, a consistent look can be achieved for any application in every space.'; $skipDictionary = array( 'all' => array( 'Visual Performance', 'ThinLine', 'Extreme', 'Architectural Series', 'Invisible Series', 'Cinema', 'Soundbar', 'Subwoofers', 'Sonance Landscape Series', 'Satellites', 'Subwoofers', 'Systems', 'Sonarray', 'Mariners', 'Medium' ) ); $replaceArray = array_map(function($val){ return '<span class="notranslate">'.$val.'</span>'; }, $skipDictionary['all']); foreach($skipDictionary['all'] AS $idx => $search) { $text = preg_replace('@(\s|\>|^)'.$search.'(\s|$)@', '\1' . $replaceArray[$idx], $text); } echo '<div>'.$text.'</div>';

preferences:
44.16 ms | 402 KiB | 5 Q