Parse values out of url

I am trying pass some js variables to a php file so that I can ultimately populate hidden fields in a gravity form. I was able to pass the values(numbers) through the url, but they are spit out in string in the url. How can I get them as individual number values? Or is there better way pass them over to php? This what the url looks like:

http://XXXXXXX/lead-results?data=50.00,8.80

This is a bit beyond my skillset right now so any advice would be welcome! Here is my js file:

  let form = document.getElementById("form");
  let volume = document.getElementById("volume");
  let denied = document.getElementById("denied");
  let charges = document.getElementById("charges");
  let rate = document.querySelector(".rate");
  let recoverable = document.querySelector(".recoverable");
  let message_1 = document.querySelector(".msg1");


  function sendData(dataToSend) {
    let data = dataToSend;
    window.location.href = "lead-results?data=" + data;
  }

  form.onsubmit = function (e) {
    e.preventDefault();

    let a = volume.value;
    let b = denied.value;
    let c = charges.value;
    let curDenialRate = parseFloat((b / a) * 100);
    c = parseFloat(c * 0.4);
    let d = rate;
    let f = recoverable;
    let messages = document.querySelectorAll(".msg");

    d.innerHTML = "";
    f.innerHTML = "";
    messages.forEach((message) => {
      message.innerHTML = "";
    });

    function formatNumber(num) {
      let formattedNum = num.toFixed(2);
      return formattedNum;
    }


    if (curDenialRate < 4) {
      d.append("Current Denial Rate: " + formatNumber(curDenialRate) + "%");
      f.append("Recoverable Dollars: " + formatNumber(c));
      message_1.append("good work");
    } else {
        
      sendData([formatNumber(curDenialRate),formatNumber(c)]);
      console.log(curDenialRate, c);
    }

    form.reset();

    return false;
  };
};

Answer

You can get the values out of the URL with $_GET and since it is a comma-separated list, you can split the values using explode. This is what I did:

    if (isset($_GET['data'])) {
        $data = explode(',', $_GET['data']);
        print_r($data); //Array ( [0] => 50.00 [1] => 8.80 )
    }