ajax return json array and set value in jquery example Example: php json response to ajax <?php echo json_encode($data); ?>