Pass Javascript Array -> PHP -
let's have javascript array bunch of elements (anywhere 50-200).
i want send php (prepared statement) using ajax. currently, .load
php file many times inside of loop, want convert array , send array once, loading php file once instead of 50-200 times.
array[i] = variable;
you use json.stringify(array)
encode array in javascript, , use $array=json_decode($_post['jsondata']);
in php script retrieve it.
Comments
Post a Comment