<?php
header ('content-type: application/json; charset=utf8');

include 'config.php';
$sql="select*from tb_pengaduan";
$query = mysqli_query($koneksi,$sql) or die(mysql_error());

$array=array();
while ($data=mysqli_fetch_assoc($query)) $array[]=$data;

$jsonfile = json_encode($array);

file_put_contents('kirim-pengaduan.json', $jsonfile);
?>