My question is simple I receive string and a number but only number show up How I can display both?
$.ajax({
type: "POST",
url: "data.php",
data: "act="+nr,
success: function (result) {
var arr = JSON.parse(result);
if ($.isArray(arr) == true) {
$.each(arr, function (i, n) {
$('#s_main #s_info').html("<p>+" + n + "</p>")
});
}
}
})
}); //ends here
my php:
$act = $_POST['act'];
$output =array();
$act2 = "TXT!!!";
array_push($output,$act);
echo json_encode($output);
By the way when i use append instead of html the result is correct but it will stack on and not delete the previous data