I have something like this:
$text = 'Getting the right kitchen appliances and home appliances for your situation is important to us.We want to make sure you are served to the best of our ability. Please feel free to contact us at any time with any inquiries you may have: <h3 style="text-align: left;"><span style="color: #0000ff;"><span style="color: #3366ff;"><span style="color: #0000ff;"><span style="color: #000000;"><strong> </strong>General inquiries (**please include your location**): </span></span></span></span>';
and preg_replace
:
preg_replace(
'/<span style="color(.+?)">(.+?)<\/span>/s',
"<span>$2</span>",
$text
);
That replaces only first occurrence. How to change that to replace every occurrences of this pattern?