I have in Javascript my array and ajax call:
righe = [];
righe.push({
ragione_sociale: $('#ragione_sociale').val(),
via: $('#via').val(),
cap: $('#cap').val(),
localita: $('#localita').val(),
provincia: $('#provincia').val(),
telefono: $('#telefono').val(),
fax: $('#fax').val(),
settore: $('#settore').val(),
attivita: $('#attivita').val(),
note: $('#note').val()
});
$.ajax({
type: "POST",
url: "/ajaxcall/inserisciAzienda.php",
data: {righe : righe},
success: function(data){
console.log("okkk "+data);
}......
and this is my inserisciAzienda.php:
<?php
$dati = array ($_POST["righe"]);
echo "result: ".$dati[0];
?>
but I have the following error:
okkk <br />
<b>Notice</b>: Array to string conversion in <b> /Applications/
XAMPP/xamppfiles/htdocs/app/badges/ajaxcall/inserisciAzienda.php</b>
on line <b>11</b><br />result: Array
I'm not able to get the array on the php file.