// Panggilan langsung dari client browser atau localhost
fetch('https://yos.my.id/terbilang/api.php?angka=15.000')
.then(res => res.json())
.then(data => {
console.log(data.data.terbilang); // Output: "Lima Belas Ribu"
})
.catch(err => console.error("Koneksi API Gagal:", err));
<?php
// Pemanggilan dari server PHP / framework Laravel / CodeIgniter
$ch = curl_init("https://yos.my.id/terbilang/api.php?angka=15000");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$hasil = json_decode($response, true);
echo $hasil['data']['terbilang'];
?>