<?php
header('Content-Type: application/json; charset=utf-8');header('Cache-Control:no-store');
$f=__DIR__.'/pemenang/winners.txt';$out=[];
if(is_readable($f)){foreach(file($f,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES)?:[] as $line){if(strpos($line,'=')===false)continue;[$n,$r]=array_map('trim',explode('=',$line,2));$digits=preg_replace('/\D+/','',$r);$out[]=['name'=>substr($n,0,4).'***','prize'=>'Rp '.number_format((int)$digits,0,',','.')];if(count($out)>=3)break;}}
echo json_encode($out,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
