PHP fwrite() လုပ်ဆောင်ချက်
❮ PHP ဖိုင်စနစ် အကိုးအကားဥပမာ
ဖွင့်ထားသောဖိုင်သို့ စာရေးပါ-
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
21
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
fwrite() သည် အဖွင့်ဖိုင်တစ်ခုသို့ စာရေးသည်။
ဖိုင် (EOF) အဆုံးတွင် သို့မဟုတ် သတ်မှတ်ထားသော အရှည်သို့ရောက်သောအခါ၊ မည်သည့်အရာသည် ပထမရောက်သည်ဖြစ်စေ လုပ်ဆောင်ချက်သည် ရပ်တန့်သွားမည်ဖြစ်သည်။
အထားအသို
fwrite(file, string, length)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
file | Required. Specifies the open file to write to |
string | Required. Specifies the string to write to the open file |
length | Optional. Specifies the maximum number of bytes to write |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ရေးထားသော bytes အရေအတွက်၊ FALSE ပျက်ကွက် |
---|---|
PHP ဗားရှင်း- | 4.0+ |
Binary Safe- | ဟုတ်ကဲ့ |
❮ PHP ဖိုင်စနစ် အကိုးအကား