PHP chunk_split() လုပ်ဆောင်ချက်
ဥပမာ
အက္ခရာတစ်ခုစီ၏နောက်တွင် string ကိုခွဲ၍ "" ကိုထည့်ပါ။ တစ်ခုချင်းစီခွဲပြီးနောက်
<?php
$str = "Hello world!";
echo chunk_split($str,1,".");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
chunk_split() function သည် string တစ်ခုကို သေးငယ်သော အပိုင်းများ ဆက်တိုက်ခွဲသည်။
မှတ်ချက်- ဤလုပ်ဆောင်ချက်သည် မူရင်းစာကြောင်းကို မပြောင်းလဲပါ။
အထားအသို
chunk_split(string,length,end)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
string | Required. Specifies the string to split |
length | Optional. A number that defines the length of the chunks. Default is 76 |
end | Optional. A string that defines what to place at the end of each chunk. Default is \r\n |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ခွဲထားသော စာကြောင်းကို ပြန်ပေးသည်။ |
---|---|
PHP ဗားရှင်း- | 4+ |
နောက်ထပ် ဥပမာများ
ဥပမာ
ဆဌမအက္ခရာတစ်ခုစီ၏နောက်တွင် string ကိုခွဲ၍ တစ်ခုစီခွဲပြီးနောက် "..." ကိုထည့်ပါ။
<?php
$str = "Hello world!";
echo chunk_split($str,6,"...");
?>
❮ PHP String အကိုးအကား