по подробней?
function myChangeHandler() {
const checkedInputs = myForm.querySelectorAll('input:checked');
const ids = Array.from(checkedInputs).map(inp => inp.id);
const idsListString = JSON.stringify(ids);
(async () => {
let answer = await fetch('handler.php',{
method: 'POST',
headers: {'Content-type' : 'application/x-www-form-urlencoded; charset=UTF-8'},
body: 'arrFromJS=' + idsListString // на сервере ловить $_POST['arrFromJS']
}),
data = await answer.text();
console.log(data);
})();
// display
out.textContent = idsListString
// save
localStorage.setItem('data', idsListString)
}