I am trying to pass JS variable[array] to PHP. My idea is that javascript will print the array as a string with innerHTML to a div
document.getElementById("id").innerHTML = variable;
and if when I click on a POST button, PHP will collect it, but all of my attempts failed... :( Can someone help me, please? Is it even possible? Are there any better or working ways how to pass a variable to PHP from JS? I would rather avoid using AJAX and other stuff