I am trying for an hour to make the replace working. There is really no reason why it shouldn't work, but it is just not working.
echo $title22;
$title22 = str_replace('–','dsdas',$title22);
echo $title22;
output:
Something – something else
Something – something else
I guess that i use wrong kind of this symbol: –, but i have tried the both option on my tastature and none of them work. Does replace works with the symbol or not?
Here is what works:
$title22 = urlencode($title22);
$title22 = str_replace("%26%238211%3B", "thisqqqqqsymbol", $title22);
$title22 = urldecode($title22);
$title22 = str_replace("thisqqqqqsymbol", $color."-", $title22);
I am not sure what %26%238211%3B is. I guess something broken.
Also this is an universal solution for problems with strange characters like this.
The - is not equal to the – character: Try this:
$title22='Something – something else';
echo $title22;
$title22 = str_replace('–','dsdas',$title22);
echo $title22;
Output:
Something – something else
Something dsdas something else