You've told the server you're sending JSON (via contentType: "application/json; charset=utf-8"
), but you're not sending JSON, you're sending URI-encoded data. This is because you've given jQuery an object for the data
option (an object with one property, whose value is a JSON string).
Your PHP code expects URI-encoded data, so to fix it just remove the contentType
option so jQuery uses its default.
If you really want to send JSON instead (which would require changing your PHP), change
data: {"data": JSON.stringify(data)},
to
data: JSON.stringify(data),
or
data: JSON.stringify({data: data}),