Can I send the value of script to php?

can you translate days into the number of php accounts?
the code is as follows:

$("-sharpdemo").multiDatesPicker({
    dateFormat: "d-m-y",
});

$("-sharpgetdates").click(function(e){
    var days;
 
    var selectedDates = $("-sharpdemo").multiDatesPicker("getdates");
    for(i in selectedDates){
        if(days)
           days += ","+selectedDates[i].split("-",1);
        else
           days = selectedDates[i].split("-",1);           
    }
   
})
Apr.09,2021

output variables with json_encode
similar to var days= ;


submit with ajax

Menu