I have to json_encode a PHP array to a JavaScript array. Unfortunately the jQuery library I am using will not properly process that array if it contains ints instead of stri
Define them in your array as strings, or if it is coming from somewhere else:
$data = json_encode(array_map('strval', $data));