I'm trying to format an array like this:
[['Apr,2012', 5],['May,2012',10],['Jun,2012',20],['Jul,2012', 13]]

from this:

while ($row = mysql_fetch_assoc($result)) {
            $dates[] = date("M,Y", strtotime($row["Datum"]));
            $data[]   = $row["forsta"];

But I don't know how to combine them in the right format?! Any hints on how to accomplish this?


How about this?

while ($row = mysql_fetch_assoc($result)) {
            $dates[] = array(
                             date("M,Y", strtotime($row["Datum"])),

Something like this:

$data = array ();
while ($row = mysql_fetch_assoc($result)) {
    $data[] = array (
        date("M,Y", strtotime($row['Datum'])), 
echo json_encode($data);

That's it, I didn't json encode it!! now it's working with
echo json_encode(($data), JSON_NUMERIC_CHECK)

Thank you so much! :)