I'm trying to replace ^
to <span>
. But, I failed. I tried with str_replace
but don't work properly.
So, my original value is:
^ffcb4a Special reward of the territory war. Used to manufacture Rank IX gears. Don't lose this.
You can see, that have a color value, starts with ^
and I want to replace that for: '<span style=color"#ffcb4a">
.
But with my str_replace
, I got this:
<span style='color:#'ffcb4a Special reward of the territory war. Used to manufacture Rank IX gears. Don't lose this.
As u can see, it doesn't work.
$item_description = str_replace('^', "<span style='color:#'" . '', $item_description);