PHP ကျူတိုရီရယ်

PHP ပင်မစာမျက်နှာ PHP မိတ်ဆက် PHP ထည့်သွင်းပါ။ PHP Syntax PHP မှတ်ချက်များ PHP Variables များ PHP Echo / Print PHP Data အမျိုးအစားများ PHP စာတန်းများ PHP နံပါတ်များ PHP သင်္ချာ PHP Constants PHP Operator များ PHP If...Else...Elseif PHP Switch PHP Loops PHP လုပ်ဆောင်ချက်များ PHP Arrays PHP Superglobals PHP RegEx

PHP Forms

PHP Form ကိုင်တွယ်ခြင်း။ PHP Form Validation PHP Form လိုအပ်ပါသည်။ PHP Form URL/E-mail PHP Form ပြီးပါပြီ။

PHP အဆင့်မြင့်

PHP နေ့စွဲနှင့် အချိန် PHP ပါဝင်ပါတယ်။ PHP ဖိုင်ကိုင်တွယ်ခြင်း PHP ဖိုင်ကို ဖွင့်/ဖတ်ပါ။ PHP ဖိုင်ကို ဖန်တီး/ရေးပါ။ PHP ဖိုင်ကို တင်ခြင်း။ PHP Cookies PHP စက်ရှင်များ PHP Filters PHP Filters Advanced PHP ပြန်ခေါ်ခြင်းလုပ်ဆောင်ချက်များ PHP JSON PHP ခြွင်းချက်

PHP OOP

PHP OOP ဆိုတာဘာလဲ PHP အတန်းများ/အရာဝတ္ထုများ PHP Constructor PHP Destructor PHP Access Modifiers PHP Inheritance PHP Constants PHP Abstract အတန်းများ PHP မျက်နှာပြင်များ PHP လက္ခဏာများ PHP Static Methods PHP Static Properties PHP Namespaces PHP Iterables

MySQL ဒေတာဘေ့စ်

MySQL ဒေတာဘေ့စ် MySQL ချိတ်ဆက်မှု MySQL သည် DB ကိုဖန်တီးပါ။ MySQL ဇယားဖန်တီးပါ။ MySQL သည် Data ကိုထည့်သွင်းပါ။ MySQL နောက်ဆုံး ID ကိုရယူပါ။ MySQL တွင် Multiple ထည့်သွင်းပါ။ MySQL ပြင်ဆင်ထားသည်။ MySQL Data ကို ရွေးပါ။ MySQL ဘယ်မှာလဲ။ MySQL Order By MySQL က Data တွေကို ဖျက်လိုက်ပါ။ MySQL အပ်ဒိတ်ဒေတာ MySQL ကန့်သတ်ဒေတာ

PHP XML

PHP XML ပါဆာများ PHP SimpleXML Parser PHP SimpleXML - ရယူပါ။ PHP XML Expat PHP XML DOM

PHP - AJAX

AJAX နိဒါန်း AJAX PHP AJAX ဒေတာဘေ့စ် AJAX XML AJAX တိုက်ရိုက်ရှာဖွေမှု AJAX စစ်တမ်း

PHP ဥပမာများ

PHP ဥပမာများ PHP Compiler PHP Quiz PHP လေ့ကျင့်ခန်းများ PHP Certificate

PHP အ ကိုးအကား

PHP ခြုံငုံသုံးသပ်ချက် PHP Array PHP ပြက္ခဒိန် PHP နေ့စွဲ PHP လမ်းညွှန် PHP အမှား PHP ခြွင်းချက် PHP ဖိုင်စနစ် PHP Filter PHP FTP PHP JSON PHP သော့ချက်စာလုံးများ PHP Libxml PHP Mail PHP သင်္ချာ PHP ထွေ PHP MySQLi PHP ကွန်ရက် PHP Output Control PHP RegEx PHP SimpleXML PHP Stream PHP String PHP Variable ကိုင်တွယ်ခြင်း။ PHP XML Parser PHP Zip PHP အချိန်ဇုန်များ

PHP fopen() လုပ်ဆောင်ချက်

❮ PHP ဖိုင်စနစ် အကိုးအကား

ဥပမာ

ဖိုင်ကိုဖွင့်ပါ၊ EOF မရောက်မချင်း စာကြောင်းများကိုဖတ်ပါ။

<?php
$file = fopen("test.txt", "r");

//Output lines until EOF is reached
while(! feof($file)) {
  $line = fgets($file);
  echo $line. "<br>";
}

fclose($file);
?>

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

fopen() လုပ်ဆောင်ချက်သည် ဖိုင် သို့မဟုတ် URL ကို ဖွင့်ပေးသည်။

မှတ်ချက်- စာသားဖိုင်သို့ စာရေးသည့်အခါ မှန်ကန်သော စာကြောင်းအဆုံး စာလုံးကို သေချာစွာ အသုံးပြုပါ။ Unix စနစ်များသည် \n ကိုအသုံးပြုသည်၊ Windows စနစ်များသည် \r\n ကိုအသုံးပြုကြပြီး Macintosh စနစ်များသည် \r ကို မျဉ်းအဆုံးစာလုံးအဖြစ် အသုံးပြုသည်။ Windows သည် ဖိုင်နှင့်အလုပ်လုပ်သောအခါ \n သို့ \r\n ဘာသာပြန်မည့် ဘာသာပြန်အလံ ('t') ကို ပေးပါသည်။ binary မုဒ်ကို အတင်းအကြပ်လုပ်ရန် 'b' ကိုသုံးနိုင်သည်။ ဤအလံများကိုအသုံးပြုရန်၊ မုဒ်ပါရာမီတာ၏နောက်ဆုံးစာလုံးအဖြစ် 'b' သို့မဟုတ် 't' ကို သတ်မှတ်ပါ။

အထားအသို

fopen(filename, mode, include_path, context)

ကန့်သတ်တန်ဖိုးများ

Parameter Description
filename Required. Specifies the file or URL to open
mode Required. Specifies the type of access you require to the file/stream.

Possible values:

  • "r" - Read only. Starts at the beginning of the file
  • "r+" - Read/Write. Starts at the beginning of the file
  • "w" - Write only. Opens and truncates the file; or creates a new file if it doesn't exist. Place file pointer at the beginning of the file
  • "w+" - Read/Write. Opens and truncates the file; or creates a new file if it doesn't exist. Place file pointer at the beginning of the file
  • "a" - Write only. Opens and writes to the end of the file or creates a new file if it doesn't exist
  • "a+" - Read/Write. Preserves file content by writing to the end of the file
  • "x" - Write only. Creates a new file. Returns FALSE and an error if file already exists
  • "x+" - Read/Write. Creates a new file. Returns FALSE and an error if file already exists
  • "c" - Write only. Opens the file; or creates a new file if it doesn't exist. Place file pointer at the beginning of the file
  • "c+" - Read/Write. Opens the file; or creates a new file if it doesn't exist. Place file pointer at the beginning of the file
  • "e" - Only available in PHP compiled on POSIX.1-2008 conform systems.
include_path Optional. Set this parameter to '1' 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.3+
PHP Changelog- PHP 7.1- ထည့်ထားသော "e" ရွေးစရာ
PHP 5.2- "c" နှင့် "c+" ရွေးစရာများကို ထည့်ထားသည်

❮ PHP ဖိုင်စနစ် အကိုးအကား