In a MySQL database i have the following entry: "Fruits & Vegetables"
where $reqVar is the array of results queried from database, including one that is "Fruits & Vegetables".
$z = rawurlencode(json_encode($reqVar));
I can then display it in page. but when i pass it back to the PHP script using AJAX using the exact same process in reverse, at some point & is converted to & and if i re-enter it into the database it looks like "Fruits & Vegetables". How can i prevent this conversion??? does the order in which i convert to and from JSON and encode/decode need to be changed?
var response = decodeURIComponent(transport.responseText)
var respObj = response.evalJSON(true);