I need to send an array
using Ajax to a script PHP.
Javascript:
$.ajax({
type: "POST",
url: "vendas_funcoes.php",
data: {"data": arrayItens},
success: function(msg){
console.log("ok");
}
});
I already tried to use te example below, but it doesn't work.
vendas_funcoes.php:
<?php
$data = stripslashes($_POST);
// usar foreach para ler o array
foreach($data as $d){
echo $d;
}
?>
How do I receive this array
im my PHP script to manipulate him ? Aparently the code below sends the array
empty.
Excuse me for possible grammar mistakes, i'm brazilian.