json_encode缺少包含日期的行的一部分

Code

$table = array();
$table['cols'] = array(

    array('label' => 'Date', 'type' => 'date'),
    array('label' => 'Orders', 'type' => 'number')

);

    $rows = array();
    while($row = oci_fetch_assoc($stid)) {

        $temp = array();

        $temp[] = array('h' => (int) $row['Date']);
        $temp[] = array('v' => (int) $row['Orders']);
        $rows[] = array('c' => $temp);

    }

    $table['rows'] = $rows;
    $jsonTable = json_encode($table);

Update

Thanks to WereWolf - The Alpha for the answer, it is using the complete date but now I have some weird problem with \ and / as below.

{
   "cols":[
      {
         "label":"Date",
         "type":"date"
      },
      {
         "label":"Orders",
         "type":"number"
      }
   ],
   "rows":[
      {
         "c":[
            {
               "h":"2014\/05\/02 00:00"
            },
            {
               "v":8
            }
         ]
      },
      {
         "c":[
            {
               "h":"2014\/05\/06 00:00"
            },
            {
               "v":10
            }
         ]
      },
      {
         "c":[
            {
               "h":"2014\/05\/07 00:00"
            },
            {
               "v":9
            }
         ]
      },
      {
         "c":[
            {
               "h":"2014\/05\/08 00:00"
            },
            {
               "v":10
            }
         ]
      }
   ]
}

It's because you have used following code:

$temp[] = array('h' => (int) $row['Date']);

Remove the (int):

$temp[] = array('h' => $row['Date']);

For example, try this:

$d = '2014/05/08 00:00';
echo $d; // 2014/05/08 00:00

Now try this:

$d = '2014/05/08 00:00';
$d = (int) $d;
echo $d; // 2014

Becaue (int) is parsing the integer from the string '2014/05/08 00:00' so it's just excluding everything from /05/08 00:00' because / it's not int.

Use this

json_encode($str, JSON_UNESCAPED_SLASHES);

For more info and other flags please see Documentation

Also remove (int) cast to date .