Post Page Advertisement [Top]

Pemrograman WebPHP

Operasi File Di PHP

Dalam pengorperasian file di bahasa pemrograman PHP dapat dilakukan dengan menggunakan fungsi-fungsi yang telah disediakan oleh PHP, yaitu sebagai berikut:

1. fopen()
Fungsi fopen() digunakan untuk membuka file
<?php $file = fopen(“welcome.txt”, “r”); ?>
Parameter fungsi fopen()

2. fclose()
Fungsi fclose digunakan untuk menutup file.

<?php//buka file
$file = fopen(“welcome.txt”, “r”);
//tutup file
fclose($file);
?>
3. fgets()
Fungsi fgets() digunakan untuk membaca file.

<?php//buka file
$file  = fopen(“welcome.txt”,”r”);
//baca file
echo fgets($file);
//tutup file
fclose($file);
?>
4. fwrite()
Fungsi fwrite() digunakan untuk menulis file.

<?php//buka file
$file = fopen(“welcome.txt”,”w+”);
//tulis file
fwrite($file,”Kalimat ini ditulis dengan mode w+”);
//tutup file
fclose($file);
?>

3 comments:

  1. Casinos Near Hollywood, AL | Mapyro
    Find Casinos Near 안산 출장샵 Hollywood, AL in real-time and see activity. 춘천 출장안마 Filter by, Best Casinos 출장마사지 Near Hollywood, Address, 동두천 출장샵 Phone 청주 출장샵 Number, Reviews, Map of Near

    ReplyDelete
  2. Kula Partners is an agency that focuses on maximizing income potential for B2B manufacturers. Our CNC machining purchasers sell within advanced, technical environments and we help them take a more targeted, account-focused approach to drive income development within area of interest markets. Like the place I grew up, they really switched their curriculum to academic-focused, in order that they have totally different academies in their high school. So if you’re interested in well being science, they've an academy for that. If you’re interested in engineering and manufacturing, they've an academy for that.

    ReplyDelete
  3. All of the really helpful casinos here are are|listed under are} reliable sites that keep gamers protected. They respect playing rules and age restrictions, offering a wonderful real money gaming experience in a safe setting devoted to 퍼스트카지노 gamers' welfare and safety on-line. After safety and legitimacy, you need to look at at|have a look at} the payout proportion of an online slot.

    ReplyDelete

Bottom Ad [Post Page]