Fungsi file_get_contents() adalah cara tercepat membaca seluruh isi file teks atau respons endpoint API ke dalam variabel string.
PHP File Handling
Contoh Kode PHP File Handling:
<!DOCTYPE html>
<html>
<body style="font-family: monospace; padding: 20px; background: #0f172a; color: #4ade80;">
<p><?php<br>
echo readfile("catatan.txt");<br>
?></p>
</body>
</html>
Uji kode PHP dan amati simulasi output server pada panel pratinjau di atas.