I send a data like page number to a php page to do some things. Then php code sends me an array. To get php array in jQuery I used json. It has returned an array but in php page it can't get the page number that I send?
jQuery:
$.ajax({
type: 'POST',
url: 'php/pagging_employs_list.php',
data: 'id=testdata',
dataType: 'json',
cache: false,
success: function(result) {
alert(result[0]);
},
});
PHP:
$params = json_decode($_POST['id']);
.
.
// here that i want to use data, not working an i vant get id value
$array = array(1,2,3,4,5,6);
echo json_encode($array);