I would like to replace the word "custom" with
<span class="persProd">custom</span>.
This is my code but not work:
$output = '<a href="www.mysite.com/custom-products"><span>Special custom products</span></a>';
$test = '~<span>custom</span>~';
$outputEdit = preg_replace($test, '<span class="persProd">custom</span>', $output);
echo $outputEdit;
How can i do? Thanks for any help