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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.