<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript"> function wyslij() { var ajax_dane = ["jeden", "dwa", "trzy", "cztery"]; var ajax_json = JSON.stringify(ajax_dane) $.post ("test.php", { 'dane': ajax_json }, function(dane) {}) ; alert("poszlo"); } </script> <body> <input type="button" id="wyslij" onClick="wyslij()" value="wyslij" /> </body> </html>
test.php
<?php $data = json_decode($_POST['dane'], true); ?>