PHP readfile() လုပ်ဆောင်ချက်
❮ PHP ဖိုင်စနစ် အကိုးအကားဥပမာ
ဖိုင်ကိုဖတ်ပါ
<?php
echo readfile("test.txt");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
readfile() function သည် ဖိုင်တစ်ခုကို ဖတ်ပြီး output buffer သို့ ရေးပေးသည်။
အကြံပြုချက်- php.ini ဖိုင်တွင် fopen ထုပ်ပိုးမှုများကို ဖွင့်ထားပါက ဤလုပ်ဆောင်ချက်ဖြင့် URL တစ်ခုကို ဖိုင်အမည်အဖြစ် သင်အသုံးပြုနိုင်ပါသည်။
အထားအသို
readfile(file, include_path, context)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
file | Required. Specifies the file to read |
include_path | Optional. Set this parameter to TRUE if you want to search for the file in the include_path (in php.ini) as well |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုတွင်ဖတ်သော ဘိုက်အရေအတွက်၊ မှားခြင်းနှင့် ကျရှုံးမှုဆိုင်ရာ အမှားတစ်ခု။ လုပ်ဆောင်ချက်အမည်၏ ရှေ့တွင် '@' ကို ထည့်ခြင်းဖြင့် အမှားအယွင်း မက်ဆေ့ချ်ကို ဝှက်ထားနိုင်သည်။ |
---|---|
PHP ဗားရှင်း- | 4.0+ |
PHP Changelog- | PHP 5.0- ထည့်သွင်းထားသော အကြောင်းအရာ ပံ့ပိုးမှု |
❮ PHP ဖိုင်စနစ် အကိုးအကား