Passing Javascript (HTML Table Contents) array to php file <p>Im very confused, I have been looking for a solution to pass HTML table contents via a javascript array (if this is indeed the best way of capturing HTML Table data) to a php file so I can then do whatever I like with the data.</p> <p>I have simplified the table shown in my example code in order to make it easier, the table i will be using live will have a lot of rows with more complicated data etc.</p> <p>The current code in get_table_data_php is:-</p> <pre><code>&lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"&gt;&lt;/script&gt; &lt;div id ="results_table"&gt; &lt;table id="stats_table"&gt; &lt;tr&gt; &lt;td&gt;Car&lt;/td&gt;&lt;td&gt;Engine&lt;/td&gt;&lt;td&gt;Color&lt;/td&gt;&lt;td&gt;Price&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Ford&lt;/td&gt;&lt;td&gt;2 Litre&lt;/td&gt;&lt;td&gt;Blue&lt;/td&gt;&lt;td&gt;22,000&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Audi&lt;/td&gt;&lt;td&gt;2.5 Litre&lt;/td&gt;&lt;td&gt;White&lt;/td&gt;&lt;td&gt;25,000&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;script&gt; var myTableArray = []; $("table#stats_table tr").each(function() { var arrayOfThisRow = []; var tableData = $(this).find('td'); if (tableData.length &gt; 0) { tableData.each(function() { arrayOfThisRow.push($(this).text()); }); myTableArray.push(arrayOfThisRow); } }); alert(myTableArray); // alerts the entire array alert(myTableArray[0][0]); // Alerts the first tabledata of the first tablerow $.ajax({ type: "POST", data: {myTableArray:myTableArray}, url: "stats.php", success: function(msg){ $('.answer').html(msg); } }); &lt;/script&gt; </code></pre> <p>The code in the stats.php file being called is as follows:-</p> <pre><code>&lt;?php var_dump($_POST); ?&gt; </code></pre> <p>The code in the calling php file runs as expected and shows (via the alert(s) which are there for my sanity) the table data as expected.</p> <p>The file called (stats.php) however does not do anything and as such I do not know if its working and what the issue is as to why it isn't.</p> <p>I am pretty new to the Javascript and Ajax side of things so any help would be appreciated.</p> <p>Regards</p> <p>Alan</p>