Use json_encode to encode values for the autocomplete boxes.