I have a code which works need to make red only the last two letters
$text = '£5,485.00';
$text = preg_replace('/(\b[a-z])/i','<span style="color:red;">\1</span>',$text);
echo $text;
need like this enter image description here
I have a code which works need to make red only the last two letters
$text = '£5,485.00';
$text = preg_replace('/(\b[a-z])/i','<span style="color:red;">\1</span>',$text);
echo $text;
need like this enter image description here
Copyright © 2021 Jogjafile Inc.
taken your question verbatim:
You may want to support Unicode (
/u-umodifier) and prevent the$to match end-of-string and new-line at end-of-string (/D-Dmodifier):u (PCRE_UTF8)D (PCRE_DOLLAR_ENDONLY)