str_replace except/else between two tag
i have a statement replacement to do in php (using str_replace or anything else?) .

i have this sentence :

"the sun is yellow when the <wrong>red sun is not yellow</wrong>"

i wish this :

"the apple is yellow when the <wrong>red sun is not yellow</wrong>"

so i need to replace a word except between two specific tags (<wrong> and </wrong>)

how to do that with str_replace or using regex in str_replace ?

a little bit harder isn't it ? i search for long hours already...no clue...

any idea ?

thanks for solution or clue or help
str_replace except/else between two tag
===

i have a statement replacement to do in php (using str_replace or anything else?) .

i have this sentence :

"the sun is yellow when the <wrong>red sun is not yellow</wrong>"

i wish this :

"the apple is yellow when the <wrong>red sun is not yellow</wrong>"

so i need to replace a word except between two specific tags (<wrong> and </wrong>)

how to do that with str_replace or using regex in str_replace ?

a little bit harder isn't it ? i search for long hours already...no clue...

any idea ?

thanks for solution or clue or help