<?php header('Content-Type: application/json'); function generateCurvePoints() { $points = []; for ($x = 0; $x <= 50; $x++) { $y = sin($x); // Exemple de fonction sinus $points[] = ['x' => $x, 'y' => $y]; } return $points; } echo json_encode(generateCurvePoints()); ?>