How to pass a php array as paramera of $ .ajax data? Ex:
<?php $nomes = array('maria','joao','jose'); ?>
$.ajax({
url: 'pagina.php',
dataType: 'json',
method: 'POST',
data: {'nomes' : <?php echo json_encode($nomes); ?>},
sucesss: function(data){
console.log(data);
}
});
And on the page get this array.