I need to add JavaScript variable to PHP array, my code is below and var date1
is JavaScript variable.
Code
$date1="2018-08-02";
$date=explode("-",$date1);
My JavaSript section is here
var date1=new Date(<?=$date[0].",".$date[1].",".$date[2]?>);
date1 place to index of array x
$incoming[$i] = array("x" =>+date1 , "y" => $total_inc);
$outgoing[$i] = array("x" => +date1, "y" => $total_out);
In this situation the value is return 0
.