I searched and it appears that I have the opposite problem to everyone else (They wonder why ajax returns null). I WANT my jquery/ajax function to return null if PHP echoes NULL but I get empty string instead. It's not a big deal but it's something that doesn't make sense for me now.
<script>
$.ajax({
url: "test.php",
success:function(result){
console.log(result);
}
});
</script>
<?php
echo NULL;
?>
//logs: empty string
I'll be embarased by the answer but I gotta know.
Thanks
echoingNULLmeans that the headers get sent, there are two line breaks and then the end, right? Which means you're serving an empty string as the content..