I have this array:
$users = array();
// Finally, loop over the results
foreach( $select as $email => $ip )
{
$users[$email] = $ip;
}
Now i want to pass this array to ajax and print in another script:
$html="<center><a href=\"#\" id=\"check_spam\" onclick=\"$.ajax({type: 'POST', url: 'mcheck.php', data:'users=$users', success: function(data){ $('#results').html(data);}});\">Check users for spam</a></center>";
mcheck.php
echo $_POST['users'];
This code does not work. How can i do this?