php and jquery ajax get data from server in json code example Example: php json response to ajax <?php echo json_encode($data); ?>