0

Hi,

I have a json_encoded array that comes out like this

{"y":33,"customTooltip":"BOK"},{"y":61,"customTooltip":"DRFlytt"},...

I need it to come out without the quotes surrounding the y and the customTooltip and singlequotes around the last value like this

{y:33,customTooltip:'BOK'},{y:61,customTooltip:'DR'},

Is this possible or should I find another approach?
I derive the array like this:

while ($row = mysql_fetch_assoc($result)) {
        $data1[] = array(
                         'y' => $row['FORSTA'],
                         'customTooltip' => $row['ANDRA']
                        );  
                            }
echo json_encode(($data1), JSON_NUMERIC_CHECK);

Thanks
/Adam

1
Contributor
1
Reply
2
Views
4 Years
Discussion Span
Last Post by adishardis
0

Ok, this didn't need to be formattad with json, I solved it like this:

$op99 .= "\n\t{y:{$row['FORSTA']}, customTooltip:'{$row['ANDRA']}'},";

Peace
/Adam

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.