I want to send an array via $.ajax to a PHP Script.
<?php
$arrid=array("a","b","c","d","e","f");
?>
<script src="jquery.js"></script>
<script>
var request = $.ajax({
url: 'paidmail.php',
dataType: 'json',
data: 'id=<?php print_r($arrid); ?>',
success: function(data) {
console.log(data);
}
});
</script>
paidmail.php just echo out the id. But my Console always throws this Exception:
unterminated string literal
How is it possible to send an array via $.ajax to another PHP script?