Printing out JSON array returned [closed]

Setting the proper dataType for the request is an important detail not considered in the answer above (this causes jQuery to send a HTTP Accept header with the request – and it will be expecting JSON data in the success callback as well):

dataType: 'json',
success:function(json){
   var content="";
   jQuery.each(json, function(i, v){
      content += '<li>' + v.post_title + '</li>';
   });
   /* like this the results won't cummulate */
   jQuery("#search-results").html(content);
}

And sending the proper HTTP header with the response was also not considered:

header("content-type: application/json; charset=utf8");

Internet Exploder doesn’t like that header – but this is another story (read more).