First, the string is being pulled from an XML file.
There’s a special character that I am trying to replace: ‘£’
When I use str_replace like so:
$ability1 = str_replace("£", "", $ability);
This is what var_dump shows:
string(138) "Argothian Pixies can't be blocked by artifact creatures.�Prevent all damage that would be dealt to Argothian Pixies by artifact creatures."
Once $ability1 is passed and wordpress inserts it into the post. This is the result.
Argothian Pixies can’t be blocked by artifact creatures.
It deletes everything after the � character.
Why would £ be changed to � when its supposed to be “”. I’m not quite sure what I’m missing
Maybe your string is in UTF-8? PHP. You would have to do something like this: