I'm not good at regular expression, but i want to create class to convert text to lower/upper case.
my method is just like this:
$textToFormat = '<strong>This is a strong text</strong>';
echo dx::text($textToFormat)->toUpper('strong')->toString();
//i hope that method will produce output:
<strong>This is a STRONG text</strong>
When i use str_replace('strong','STRONG',$textToFormat) as you guess it produce output: <STRONG>This is a STRONG text</STRONG>';
So the question is how to write code that only make changes for words that is not in tagging format?
I think maybe eregi_replace() or preg_replace() can do that. But i got stack now!