PHP二维数组到Javascript数组

I had php multi dimensional array

 Array
(
    [0] => Array
        (
            [WorkHrs] => 9826
            [Focus_Date] => 2010-02-10 
        )

    [1] => Array
        (
            [WorkHrs] => 9680            
            [Focus_Date] => 2010-02-11
        )

)

and I want to convert it in Javascript to

 myArray = [['2010-02-10', 9826],['2010-02-11', 9680]];
$jsArray = array();
foreach($myArray as $array) {
   $jsArray[] = array($array['Focus_Date'], (int) $array['WorkHrs']); 
}

echo json_encode($jsArray);

That's pretty much exactly what json_encode does. Input is a PHP-array (other datatypes accepted), output is what you describe.

echo json_encode(array_map(array_values, $arr));

EDIT: To get it in the specified order:

function to_focus_work_array($arr)
{
  return array($arr['Focus_Date'], $arr['WorkHrs']);
}

echo json_encode(array_map('to_focus_work_array', $arr));

have you tried the json_encode()? refer to http://php.net/manual/en/function.json-encode.php