Parsing Javascript Array To Php Issue
The problem is that on each button click a new array is created. Is that possible to store all of the button values to a single array? How is that possible. You can see it here I p
Solution 1:
I see your issue here, but the only way to parse a "single" array to php is to convert that into string. Otherwise leave it as it is and process it in PHP as an array.
Here is how to convert your array into string in Javascript:
$('#validate').click(function(e) {
let k = items.join("");
$.ajax({
type: "POST",
url: "somephp.php",
dataType: "json",
data: {
UserInput:k
}
})
});
Post a Comment for "Parsing Javascript Array To Php Issue"