I am seeing a currency symbol Â
when I store my data into a MySQL table, I have tried trim()
, but still the Â
has not been removed.
JavaScript:
var numZAR=new Intl.NumberFormat("en-ZAR",{
style:"currency",
currency:"ZAR",
});
var total_raw = numZAR.format(Number(final_item_total).toFixed(2));
var total_string=total_raw.toString();
var total_show = total_string;
$('#final_total_amt').text(total_show);
$('#me').val(total_show); //displaying on front end textbox
PHP code before the MySQL statement:
$final = $_POST["me"];
$final = trim($final,"ZAR ");
This is what shows in the table: Â 2,212.00