There is an HTML table which I put in an array on JS. Next, you need to transfer the array from JS to PHP array for further work.
This code puts the entire table data into an array in JS:
var myArray = new Array(); $(document).ready(function() { var table = $('.products__table'); var tr = table.children().children().not('tr:first-child'); $(tr).each(function(i) { myArray.push($(this).text()); }); console.log(myArray); $('#send').click(function() { for (var i = 0; i < myArray.length; i++) { window.location.href = "admin.php?name=" + myArray[i]; } }); }); console.log (myArray) returns everything correctly. 
$test = $_GET['name']; echo $testi; But it gives only the last element.
What is the problem? Thank.


window.location.href = "admin.php?name=" + myArray[i];? Naturally, the last opening URL will contain the last element of the array. - u_mulder Nov.