Latihan memasukan data menggunakan fgets

 fungsi fgets adalah untuk memasukan data pada file teks menggunakan perintah:

<html>
<head>
<title>Poesing</title>
<body>
<?
$file = “biodata.dat”;
$bukafile=fopen(“$file”,”r”);
if(!$bukafile)
{
echo “File gagal dibuka”;
}else{
echo “Menampilkan isi dari file.dat<br>”;
while (!feof($bukafile))
{
$isifile=fgets($bukafile,255);
echo $isifile;
}
fclose($bukafile);
}
?>
<?
include “contoh2_20.php”;
include “contoh2_21.php”;
?>

</body>
</html>

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s


Ikuti

Get every new post delivered to your Inbox.