I am experiencing a problem where data loaded into input fields are being changed from special characters to actual characters which causes problems when submitted.
In other words, instead of: ñ
this character is displayed and submitted: ñ
The end result is question marks in the output.
What is the best way to manage this?
You'll need to htmlentity it:
echo '<input type="text" name="myText" value="' . htmlentities('ñ') . '" />';
This will output something like:
<input type="text" name="myText" value="&ntilde;" />
Which will show an input in your HTML page containing: ñ