Hello Readers if you want to send the array into another PHP page then you can use the code below:-
I have array made by function .push. In array is very large data. How is the best way send this to PHP script?
dataString = array(a->b); // array
$.ajax({
type: "POST",
url: "script.php",
data: dataString,
cache: false,
success: function(){
alert("OK");
}
});
Now Create a file script.php and paste the following code to get it.
$data = $_POST['data'];
// here i would like use foreach:
foreach($data as $d){
echo $d;
}
0 Comment(s)