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 preg_split() လုပ်ဆောင်ချက်

❮ PHP RegExp အကိုးအကား

ဥပမာ

ရက်စွဲတစ်ခုအား ၎င်း၏အစိတ်အပိုင်းများအဖြစ်ခွဲရန် preg_split() ကိုသုံးပါ

<?php
$date = "1970-01-01 00:00:00";
$pattern = "/[-\s:]/";
$components = preg_split($pattern, $date);
print_r($components);
?>

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

လုပ်ဆောင်ချက်သည် ပုံမှန်အသုံးအနှုန်းတစ်ခု၏ ကိုက်ညီမှုများကို ပိုင်းခြားပေးသည့် အ preg_split()ရာများအဖြစ် အသုံးပြုကာ string တစ်ခုအား array တစ်ခုသို့ ခွဲပေးသည်။


အထားအသို

preg_split(pattern, string, limit, flags)

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

Parameter Description
pattern Required. A regular expression determining what to use as a separator
string Required. The string that is being split
limit Optional. Defaults to -1, meaning unlimited. Limits the number of elements that the returned array can have. If the limit is reached before all of the separators have been found, the rest of the string will be put into the last element of the array
flags Optional. These flags provide options to change the returned array:
  • PREG_SPLIT_NO_EMPTY - Empty strings will be removed from the returned array.
  • PREG_SPLIT_DELIM_CAPTURE - If the regular expression contains a group wrapped in parentheses, matches of this group will be included in the returned array.
  • PREG_SPLIT_OFFSET_CAPTURE - Each element in the returned array will be an array with two element, where the first element is the substring and the second element is the position of the first character of the substring in the input string.

နည်းပညာဆိုင်ရာအသေးစိတ်

ပြန်ပို့တန်ဖိုး- အကြောင်းအရာတစ်ခုစီသည် ပုံမှန်အသုံးအနှုန်းတစ်ခု၏ ကိုက်ညီမှုဖြင့် ပိုင်းခြားထားသော input string ၏ အစိတ်အပိုင်းတစ်ခုနှင့် သက်ဆိုင်သည့် အခင်းအကျင်းတစ်ခုစီကို ပြန်ပေးသည်
PHP ဗားရှင်း- 4+

နောက်ထပ် ဥပမာများ

ဥပမာ

PREG_SPLIT_DELIM_CAPTURE အလံကို အသုံးပြုခြင်း-

<?php
$date = "1970-01-01 00:00:00";
$pattern = "/([-\s:])/";
$components = preg_split($pattern, $date, -1,
PREG_SPLIT_DELIM_CAPTURE);
print_r($components);
?>

ဥပမာ

PREG_SPLIT_OFFSET_CAPTURE အလံကို အသုံးပြုခြင်း-

<?php
$date = "1970-01-01";
$pattern = "/-/";
$components = preg_split($pattern, $date, -1,
PREG_SPLIT_OFFSET_CAPTURE);
print_r($components);
?>

❮ PHP RegExp အကိုးအကား