PHP ဖိုင်() လုပ်ဆောင်ချက်
❮ PHP ဖိုင်စနစ် အကိုးအကားဥပမာ
ဖိုင်တစ်ခုကို array တစ်ခုသို့ ဖတ်ပါ-
<?php
print_r(file("test.txt"));
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
file() သည် array တစ်ခုသို့ ဖိုင်တစ်ခုကို ဖတ်သည်။
အခင်းအကျင်းတစ်ခုစီတွင် လိုင်းအသစ်အက္ခရာကို တွဲဆက်ထားသဖြင့် ဖိုင်မှ စာကြောင်းတစ်ကြောင်းပါရှိသည်။
အထားအသို
file(filename, flag, context)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to read |
flag |
Optional. Can be one or more of the following constants:
|
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream. Can be skipped by using NULL. |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ခင်းကျင်းတစ်ခုရှိ ဖိုင်တစ်ခုလုံး၊ ပျက်ကွက်မှုတွင် FALSE |
---|---|
PHP ဗားရှင်း- | 4.0+ |
Binary Safe- | ဟုတ်ပါတယ်၊ PHP 4.3 မှာ |
❮ PHP ဖိုင်စနစ် အကိုးအကား