How can I replace the text, for example: c2stackoverflow to
span style="color:#ffdc50">stackoverflow</span>'
I try to do this:
<?php
$string = "c2stackoverflow";
$string = preg_replace("/c2([A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ])+$/", '<span style="color:#ffdc50">$1</span>', $string);
echo $string;
But the output is:
<span style="color:#ffdc50">w</span>