<?php
header('Content-Type: application/json');
$su = (int)$_POST['su'];
$length = (float)$_POST['length'];
$areaPrice = (float)$_POST['areaPrice'];

$unitPrice = round($length * $areaPrice);
$totalPrice = round($unitPrice * $su);

echo json_encode([
  'unitPrice' => number_format($unitPrice),
  'totalPrice' => number_format($totalPrice)
]);