function getInfo(id) { $.ajax({ url: '/getInfo.php', data: { id: id }, success: function(response) { console.log(response); } }); }
<?php $obj = New MaClass(); $valRetournee = $obj->MaFonctionPHP($_GET['id']); header('Content-Type: application/json'); echo json_encode($valRetournee);