Organizational Research By

Surprising Reserch Topic

send array with ajax to php script


send array with ajax to php script  using -'php,javascript,jquery,ajax'

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?
   $.ajax({
        type: "POST",
        url: "script.php",
        data: dataString,
        cache: false,

        success: function(){
            alert("OK");
        }
    });


script.php:

  $data = $_POST['data'];

  // here i would like use foreach:

  foreach($data as $d){
     echo $d;
  }


How is the best way for this?
    
asked Oct 19, 2015 by mtabakade
0 votes
1 view



Related Hot Questions



Government Jobs Opening


...